You are viewing a single comment's thread. Return to all comments →
I wasted an hour just to figure out this "Trim()" issue, obviously at least twice of the time taken to write the actual code.
The problem is, the bug is in the predefined part of the code! I wish HackerRank can have the predefined section refined more, or they shall not provide it at all. Also the test data itself is buggy. It shall not have the trailing whitespace though it is really common in the real world.