Available question text
Parse and evaluate a space-separated arithmetic expression with integers, multi-letter variables, parentheses and +, -, * (obeying precedence), applying given variable substitutions, then expand and simplify into polynomial-like terms by multiplying out, combining like terms (summing coefficients), dropping zero coefficients, and returning terms sorted by descending degree and lexicographic order.
Key challenges: implement a parser/evaluator with correct precedence and represent terms as (coefficient, sorted variable multiset) to support multiplication, hashing, and ordering.
Related questions
Continue with questions that share topics or the same question type.
- Basic Calculator
Coding
- Basic Calculator II
Coding · Math · Stack · String
- Basic Calculator III
Coding · Math · Recursion · Stack
- 2 easy questions. Basic data structures/algorithm.
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Google
Leetcode 770. Basic Calculator IV
Reported Oct 7, 2024 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source