Valid Parantehsis
Valid Parantehsis
if(ch == '('){
stack.push(ch);
firstChar = stack.peek();
}
if(ch == '['){
stack.push(ch);
firstChar = stack.peek();
}
if(ch == '{'){
stack.push(ch);
firstChar = stack.peek();
}
}
return stack.isEmpty();
}
}