Reverse Words in a String
Example 1:
Input: s = "the sky is blue"
Output: "blue is sky the"Example 2:
Input: s = " hello world "
Output: "world hello"
Explanation: Sizning teskari satringizda oldingi yoki keyingi bo'shliqlar bo'lmasligi kerak.Example 3:
Input: s = "a good example"
Output: "example good a"
Explanation: Ikki so'z orasidagi bir nechta bo'shliqni teskari satrda bitta bo'sh joyga qisqartirishingiz kerak.Cheklovlar
Last updated