Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
With input of "ab(cd", output should be "ab(cd". But with this you would get "ab". Maybe it would be useful to save last index of where you open parentheses, and in the end of loop, there could be a check if sum == 0. If not, sum += str.substring(savedIndex).