1451. Rearrange Words in a Sentence
Description
**Input:** text = "Leetcode is cool"
**Output:** "Is cool leetcode"
**Explanation:** There are 3 words, "Leetcode" of length 8, "is" of length 2 and "cool" of length 4.
Output is ordered by length and the new first word starts with capital letter.**Input:** text = "Keep calm and code on"
**Output:** "On and keep calm code"
**Explanation:** Output is ordered as follows:
"On" 2 letters.
"and" 3 letters.
"keep" 4 letters in case of tie order by position in original text.
"calm" 4 letters.
"code" 4 letters.ac
Previous1450. Number of Students Doing Homework at a Given TimeNext1452. People Whose List of Favorite Companies Is Not a Subset of Another List
Last updated