Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Check paranthesis expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bool verify (char input[]) {

if (input[i] == ')') {
// if the stack is empty, or the last parenthesis is different
// than the one we are closic, then the input is wrong
// than the one we are closing, then the input is wrong
if (isEmpty() || Stack[ind] != 1) return false;
else {
Stack[ind] = 0;
Expand All @@ -34,7 +34,7 @@ bool verify (char input[]) {
}
if (input[i] == ']') {
// if the stack is empty, or the last parenthesis is different
// than the one we are closic, then the input is wrong
// than the one we are closing, then the input is wrong
if (isEmpty() || Stack[ind] != 2) return false;
else {
Stack[ind] = 0;
Expand All @@ -43,7 +43,7 @@ bool verify (char input[]) {
}
if (input[i] == '}') {
// if the stack is empty, or the last parenthesis is different
// than the one we are closic, then the input is wrong
// than the one we are closing, then the input is wrong
if (isEmpty() || Stack[ind] != 3) return false;
else {
Stack[ind] = 0;
Expand Down