Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def balance(chars: List[Char]): Boolean = {
- def innerBalance(chars: List[Char], counter: Int) : Boolean = {
- if (counter < 0) return false
- if (chars.isEmpty) return counter == 0
- return innerBalance(chars.tail, counter + smth(chars.head))
- }
- return innerBalance(chars, 0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement