C.H. Robinson Interview Question

Sort a list by ranking. Reverse a string and compare