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
@ccoffringreedy_001 solution (possibly others too, haven't looked into them yet) keeps adding sets until getting full coverage. However - some sets are added for which their items are already covered by previously added sets, thus adding cost but without any value gain.
By adding the following inside the main loop: (tested in 3.10, not in earlier Python versions)
if len(set(s.items).intersection(covered)) == len(set(s.items)):
continue
this can be avoided
The text was updated successfully, but these errors were encountered:
@ccoffrin
greedy_001
solution (possibly others too, haven't looked into them yet) keeps adding sets until getting full coverage. However - some sets are added for which their items are already covered by previously added sets, thus adding cost but without any value gain.By adding the following inside the main loop: (tested in 3.10, not in earlier Python versions)
this can be avoided
The text was updated successfully, but these errors were encountered: