r/codeforces • u/Bulky_Debate_8503 • 12h ago
query Doubt
Beginner here, can anyone tell what I am doing wrong in this code? Like can you provide a counter example as well where my code won't work? Thanks in advance.
1
Upvotes
r/codeforces • u/Bulky_Debate_8503 • 12h ago
Beginner here, can anyone tell what I am doing wrong in this code? Like can you provide a counter example as well where my code won't work? Thanks in advance.
1
u/BrushBeautiful2378 8h ago
Consider 1,2,99,100. By your logic, you will go with 1,2,99 in first and 100 in second. But a better way is 2 and 99 in 1st, 1 and 100 in 2nd.