map(lambda x: x[1], sorted(zip(list(range(0, len(nums))), sorted(nums, key=lambda
    x: str(x), reverse=True)), key=lambda x: str(x[1]) if not str(x[1]).
    endswith('0') else str(str(x[1] - 1)[0]) + str(x[0]), reverse=True))
How to sort only few values inside a list in Python