You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Understand what the interviewer is asking for by using test cases and questions about the problem.
What is there is only one word in the sentence?
The function should return the original string.
P-lan
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Reverse a list of the input words and return the joined sentence.
1) First, split the sentence into a list of words
2) Slice the entire list with a negated step parameter
3) Join the list of words back into a sentence
4) Return the reversed sentence