id/email
password
forgot password
about | help | done | prefs | create account
JavaBat java practice problems

Recursion-1 > nestParen
prev  |  next  |  chance

Given a string, return true if it is a nesting of zero or more pairs of parenthesis, like "(())" or "((()))". Suggestion: check the first and last chars, and then recur on what's inside them.

nestParen("(())") → true
nestParen("((()))") → true
nestParen("(((x))") → false

...Save, Compile, Run

See Also: Example Code Java help: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  JavaBat  >  Recursion-1

Forget It! -- delete my code for this problem 381.0

Copyright Nick Parlante 2006-09 - privacy