Can you tell me what's wrong with my code?

Below is the solution for Sum It Up Problem:-

hi,
what problem are u exactly facing with dis code?

I am passing 2 test cases out of 4 and two are failing.

instead of making set, try storing the strings in vector since set will sort the string lexographically but the output is required in the order in the increasing order of first integer.
for eg. if you store β€œ11 2” and β€œ4 9” in set, you will get output as β€œ11 9” β€œ4 9” but the required output is β€œ4 9” β€œ11 2”

1 Like

Thanks @Yash_N it’s resolved using vectors :slightly_smiling_face:

I hope I’ve cleared your doubt. Please try to rate your experience. Your feedback is very important as it help us improve our platform and provide better learning experience.