@@ -131,7 +131,7 @@ def greedy(nums, k, is_reversed):
131
131
ordered_set .remove (x )
132
132
freq_to_nodes .pop (len (stks )- curr )
133
133
# greedily fill the contiguous ordered elements into the first vacant subset until it is full,
134
- # otherwise, the result sum would get larger
134
+ # otherwise, the result sum would get larger => in fact, this is wrong
135
135
to_remove = []
136
136
direction = (lambda x :x ) if not is_reversed else reversed
137
137
for x in direction (ordered_set ):
@@ -305,7 +305,7 @@ def greedy(nums, k, is_reversed):
305
305
ordered_set .remove (ordered_set .find (x ))
306
306
freq_to_nodes .pop (len (stks )- curr )
307
307
# greedily fill the contiguous ordered elements into the first vacant subset until it is full,
308
- # otherwise, the result sum would get larger
308
+ # otherwise, the result sum would get larger => in fact, this is wrong
309
309
it = ordered_set .begin ()
310
310
while it != ordered_set .end ():
311
311
x = it .val
@@ -359,7 +359,7 @@ def greedy(nums, k, is_reversed):
359
359
remain -= count [x ]
360
360
count [x ] = 0
361
361
# greedily fill the contiguous ordered elements into the first vacant subset until it is full,
362
- # otherwise, the result sum would get larger
362
+ # otherwise, the result sum would get larger => in fact, this is wrong
363
363
for x in sorted_keys :
364
364
if not count [x ]:
365
365
continue
0 commit comments