Question: 9) Write a recursive function (static method) called parenCleaner that takes a String as a parameter, and returns a new String where all of the
9) Write a recursive function (static method) called parenCleaner that takes a String as a parameter, and returns a new String where all of the open parentheses (i.e. () have been moved to the beginning of the String and all of the closed parens (i.e. )) have been moved to the end of the String. This example question may help with this question (this is probably easier than you think). For example:
parenCleaner(x()y()z(a)) => (((xyza)))
parenCleaner(f(x,y,z)) => (fx,y,z)
parenCleaner(pumpkins) => pumpkins
public static String parenCleaner(String str) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
