Recursive Functions Sorting Lists Python Hackerrank