224. Basic Calculator

T: O(n)

S: O(n)

巧妙之處在於何時入 stack, 看到 ()就想到 stack

( => push

) => pop, cal result

or like this, just chande number part

recursion

T: O(k*n), k is call dfs times, n is String length

S: O(n)

Last updated

Was this helpful?