C.H. Robinson interview question

Sort a list by ranking. Reverse a string and compare