Search
⌘K

Leetcode 439. Ternary Expression Parser

Parse and evaluate a nested ternary expression string (with single-character operands and '?' and ':' operators), respecting the ternary operator's right-to-left associativity, and return the final resulting value. The core challenge is correctly handling arbitrary nesting and precedence, commonly approached with a right-to-left scan using a stack or recursive parsing.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.