LeetCode 2561 - Rearranging Fruits
LeetCode Problem 2561 Difficulty: 🔴 Hard Topics: Array, Hash Table, Greedy, Sort Solution Problem Understanding This problem gives us two arrays, basket1 and basket2 , where each element represents the cost of a fruit in a basket. Both baskets contain exactly n fruits. Our goal is to make the two baskets equal, where equality means that after sorting both arrays, they contain exactly the same multiset of values. We are...