Reversing the words in the string
Given a string, how do we reverse the words inside the string? For example if the input string is “this is a test” the output should be “test a is this”. The algorithm is simple. This can be done in two steps. The first step is to reverse the entire string. In the second step…