我在代码的最后一行有类型不匹配
def balance(chars: List[Char]): Boolean = {
def f(chars: List[Char], count: Int) :Boolean=
if(chars.isEmpty) {(count==0)}
else if (chars.head == '(') f(chars.tail,count+1)
else if(chars.head == ')') f(chars.tail,count-1)
else f(chars.tail,count)
} //Type mismatch; found: unit required Boolean