Score of Parentheses
Medium
Stack (Advanced)
A balanced parentheses string scores 1 for '()', A + B for the concatenation AB, and 2 * A for '(A)'. Print the score of the given string.
Constraints
2 <= len(s) <= 50
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.