There can be multiple spaces between two words, and there can be leading or trailing spaces. In the output reversed string, you need to put a single space between two words, and your reversed string should not contain leading or trailing spaces.
Reverse Words in a String
Easy
10m average time
90% success
0/40
Asked in companies
You are given a string 'str' of length 'N'.
Your task is to reverse the original string word by word.
The following metrics were computed from 1 interview experience for the Zomato Software Engineer (Internship) role in Nānded, Maharashtra.
Zomato's interview process for their Software Engineer (Internship) roles in Nānded, Maharashtra is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for Zomato's Software Engineer (Internship) interview process in Nānded, Maharashtra.