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