diff --git a/Lecture-055/07_Redundant_Brackets.cpp b/Lecture-055/07_Redundant_Brackets.cpp index d909b8d..1297830 100644 --- a/Lecture-055/07_Redundant_Brackets.cpp +++ b/Lecture-055/07_Redundant_Brackets.cpp @@ -8,7 +8,7 @@ bool redundantBracket(string str) { bool redundancy = true; char ch = str[i]; - if(ch=='(' || ch=='+' || ch=='-' || ch=='-' || ch=='/') { + if(ch=='(' || ch=='+' || ch=='-' || ch=='*' || ch=='/') { st.push(ch); } else { @@ -16,7 +16,7 @@ bool redundantBracket(string str) { while(st.top() != '(') { char top = st.top(); - if(top=='+' || top=='-' || top=='-' || top=='/') { + if(top=='+' || top=='-' || top=='*' || top=='/') { redundancy = false; } st.pop(); @@ -49,4 +49,4 @@ int main() { } return 0; -} \ No newline at end of file +}