Saksham_Sahgal's blog

By Saksham_Sahgal, history, 3 years ago, In English

Link to my submission

My approach was to map characters 'a' with the first character in the string then ,'b' with the second character in the string .. and so on , then while taking input of the N strings I converted those string(X) to a mapped string(Y) (each character conveted to its mapped value) and stored that mapped string(Y) in a multiset key with vaue as the original string(X), i did this as multiset will sort the keys lexographically and then i just printed the values of the map,

the first two given testcase gives right ans , but i dont understand why all other testcases give WA.

ps. i also solved it with custom comparator function which got AC(As expected) , but i don't understand why this approach gives me WA

  • Vote: I like it
  • 0
  • Vote: I do not like it