cna you check this why this code not passing all test cases
public static boolean isBalanced(String str, StacksUsingArrays st) throws Exception {
for(int i=0; i<str.length(); i++)
{
if(str.charAt(i)=='('||str.charAt(i)=='{'||str.charAt(i)=='[')
{
st.push(str.charAt(i));
}
else if(str.charAt(i)==')'||str.charAt(i)=='}'||str.charAt(i)==']')
{
if(st.isEmpty())
{
return false;
}
if(str.charAt(i)=='}')
{
if(st.pop()=='{')
{
st.pop();
}
else
{
return false;
}
}
else if(str.charAt(i)==')')
{
if(st.pop()=='(')
{
st.pop();
}
else
{
return false;
}
}
else if(str.charAt(i)==']')
{
if(st.pop()=='[')
{
st.pop();
}
else
{
return false;
}
}
}
else
{
continue;
}
}
if(st.isEmpty())
{
return true;
}
else
{
return false;
}
}