Skip to content

Instantly share code, notes, and snippets.

@aljorhythm
Created May 17, 2020 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aljorhythm/6e324a317a5489bc62ae735e292b8c5e to your computer and use it in GitHub Desktop.
Save aljorhythm/6e324a317a5489bc62ae735e292b8c5e to your computer and use it in GitHub Desktop.
class Solution(object):
def arrangeWords(self, text):
result = " ".join(sorted(text.lower().split(),key = lambda w: len(w)))
return result[:1].upper() + result[1:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment