Help needed on Problem 372A

Revision en2, by parth_15, 2017-09-24 10:33:00

Hello everyone, I was solving this problem but I am constantly getting WASubmission. I have used greedy approach. I first sorted the array and started checking from right to left that if we can find pair for ith index,then match up. Treeset is used for that purpose. But I am not able to find any bug. Please help.

Tags greedy, treeset, help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English parth_15 2017-09-24 10:33:00 8 Tiny change: 'ving this problem [problem]' -> 'ving this [problem]'
en1 English parth_15 2017-09-24 10:32:25 457 Initial revision (published)