Skip to content

Instantly share code, notes, and snippets.

@JohnItoo
Created February 15, 2020 08:16
Show Gist options
  • Save JohnItoo/d1d8cff2fdbd824717c196e89d39d450 to your computer and use it in GitHub Desktop.
Save JohnItoo/d1d8cff2fdbd824717c196e89d39d450 to your computer and use it in GitHub Desktop.
public void decideOne() {
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