← ALL NOTES
Algorithms

1807. Evaluate the Bracket Pairs of a String

Because the brackets never nest, this is a flat problem: one left-to-right scan over the string, replacing each (key) with a value from an unordered_map or with a '?'. O(N+K) time.

Loading…