Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions