Question: 4. (15 minutes) (20 points) Write a method that takes a string and returns the reversed string obeying the following rule: Spaces must be kept
4. (15 minutes) (20 points) Write a method that takes a string and returns the reversed string obeying the following rule: Spaces must be kept in the same order as the original string. For instance if the input string is "cs 101 java". Your method should return "av aj1 01sc". Hint: Write a method which returns a new string after reversing and removing all the spaces inside the given string. Use this method as an helper
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
