General Motors (GM) interview question

Reverse a string and match a test case