Cognizant Interview Question

Sorting array, reversing string in python