Hello CodeChef,

Problem: ZCO14003

Contest: LRNDSA01

My Solution:

My code ran successfully for all testcases. But i don’t understand why half of the testcase was failing, if i was using TreeSet instead of ArrayList.

TreeSet does not allow duplicate values so if the input has 2 or more person with same budget, your code with TreeSet will fail.