-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lesson2-AndrewKoldyrev-homework #160
base: nick/lesson2
Are you sure you want to change the base?
lesson2-AndrewKoldyrev-homework #160
Conversation
export const closeBracker = ")"; | ||
|
||
export const bracketChecker = function (line: string): boolean { | ||
const stackForBracketCheckArray = line.split(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line.split('').reduce((acc, word) => word === openBracket && acc+1, 0)
|
||
if (isValidNumberPush) { | ||
result.push(Number(item)); | ||
} else if (isValidOperatorPush) { | ||
} else if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if без аргумента
const stack = parser(line); | ||
|
||
if (stack === null) { | ||
throw new TypeError("Unexpected string"); | ||
} | ||
|
||
const firstPrioritiesRes = firstPrioritiesCalc(stack); | ||
const bracerStack = stack; | ||
while (bracerStack.find((index) => index == openBracket)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
данную операцию можно упростить попробовать
No description provided.