Given a string expression representing a nested ternary expression, evaluate the expression and return its result as a string.
You can assume that the ternary expression evaluates from right to left.
Constraints:
expression.length
expression consists of digits, 'T', 'F', '?', and ':'.
It is guaranteed that expression is a valid ternary expression and that each number is a single digit number.
Given a string expression representing a nested ternary expression, evaluate the expression and return its result as a string.
You can assume that the ternary expression evaluates from right to left.
Constraints:
expression.length
expression consists of digits, 'T', 'F', '?', and ':'.
It is guaranteed that expression is a valid ternary expression and that each number is a single digit number.