Skip to content

Commit 0ad5696

Browse files
authored
Update rearranging_fruits.py
1 parent c9da86c commit 0ad5696

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

greedy_methods/rearranging_fruits.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff 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.
9-
101
from typing import List
112
from collections import defaultdict
123

0 commit comments

Comments
 (0)