Apple | Phone Screen | Reverse Words in a String
Anonymous User
1973

Position: Test Engineer

Variation of https://leetcode.com/problems/reverse-words-in-a-string/

Given an input string, reverse the string word by word.

Example 1:

Input: "How Are you"
Output: "you Are How"

Example 2:

Input: "How how Are HOW You are you"
Output: "You Are How"
Explanation: If words are repeated, the first occurence should be considered. 
Comments (2)