For example if the parenthesis/brackets is matching in the following:
({}) (()){}() ()
and so on but if the parenthesis/brackets is not mat
here is my solution using c++ if brackets are matched then returns true if not then gives false
#include #include #include using namespace std; int matchbracket(string expr){ stack st; int i; char x; for(i=0;i>expr; if(matchbracket(expr)==1) cout<<"\nTRUE\n"; else cout<<"\nFALSE\n"; }