Guest User

stupid scala

a guest
Apr 6th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.24 KB | None | 0 0
  1.     def balancing(count: Integer, chars: List[Char]): Boolean={
  2.       if (chars.isEmpty)
  3.         if (count==0) true else false
  4.       else{
  5.         val head=chars.head
  6.         if (head =='(') count+=1
  7.         else if (head == ')') count-=1
  8.     }
Advertisement
Add Comment
Please, Sign In to add comment