Back Clear
# Your Problem: # Given a string that contains a single pair of parenthesis, compute # recursively a new string made of only of the parenthesis and their # contents, so "xyz(abc)123" yields "(abc)". # # # parenBit("xyz(abc)123") → "(abc)" # parenBit("x(hello)") → "(hello)" # parenBit("(xy)1") → "(xy)" # # Credit for this problem goes to Nick Parlante from CodingBat.com # Do not modify anything outside of the function or the function itself. # CODE START def getParenBit(str:str) -> str: # CODE END # Press Ctrl+E (Command+E on mac) to test your code