HTMLify

LeetCode - Sorting the Sentence - Python
Views: 23 | Author: abh
class Solution:
    def sortSentence(self, s: str) -> str:
        return " ".join([w[:-1] for w in sorted(s.split(), key=lambda e:int(e[-1]))])

Comments