Function that returns true if the equation is valid
bool isValid ( string str ) { int k = 0 ; string operands [ 5 ] = " " ; char operators [ 4 ] ; long ans = 0 , ans1 = 0 , ans2 = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) {