Created
February 15, 2020 08:07
-
-
Save JohnItoo/5534d8f7735ddc8a731c67ede33112dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void decideOne() { | |
Collections.sort(slices); | |
int sliz = slices.size(); | |
for (int i = sliz - 1; i >= 0; --i) { | |
if (maxPizzas - slices.get(i) < 0) continue; | |
maxPizzas -= slices.get(i); | |
solution.add(i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment