Refer for code: -
All test cases are failing
@ambuj_0909
The way you prints the final output is wrong. why are you printing each value of map in different lines? you have to print output in single line.
just change the line no. 25 to cout<<mapp.first<<" ";