Efficiently reverse the order of the words (not characters) in an array of characters

前端 未结 21 1894
[愿得一人]
[愿得一人] 2020-11-28 04:40

Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

Example input and

21条回答
提交回复
热议问题