You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: greedy_methods/rearranging_fruits.py
-9Lines changed: 0 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,3 @@
1
-
# it's a leetcode question no. 2561 where You have two fruit baskets containing n fruits each. You are given two 0-indexed integer arrays basket1 and basket2 representing the cost of fruit in each basket.
2
-
# You want to make both baskets equal. To do so, you can use the following operation as many times as you want:
3
-
4
-
# Chose two indices i and j, and swap the ith fruit of basket1 with the jth fruit of basket2.
5
-
# The cost of the swap is min(basket1[i],basket2[j]).
6
-
# Two baskets are considered equal if sorting them according to the fruit cost makes them exactly the same baskets.
7
-
8
-
# Return the minimum cost to make both the baskets equal or -1 if impossible.
0 commit comments