Basic Calculator

Problem

Given a string s representing an expression, implement a basic calculator to evaluate it.

Thought Process

  • We have a sign variable that keeps track of the previous sign

Solution

Time Complexity

  • Time: O(n)

  • Space: O(n)

Last updated

Was this helpful?