Can't figure out how to handle multiple operators

Every test are passing in my project. But when the test tests the project with 5 *-+5 operation, the #test’s 13 failed. How can I avoid those operators combinations?

Project Link:

Thank you.

Hello AndrewAung11,

Possible suggestion when adding to eq Array.

For the operators - you could test for last value in array and if it is not a number then do replace the operator with current operator.

1 Like

@jaket Thank you, your comment give me the hint to check if the word before it is a minus sign before appending another operator.

glad to help - happy coding :slight_smile:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.