Flatten Parentheses in a Plus-Minus Expression
Asked at Oracle · Coding Questions · Difficulty: Medium · Last asked Nov 10, 2026
Given an arithmetic expression that uses single-letter variables, plus and minus signs, and parentheses nested to any depth, rewrite it without any parentheses so that it keeps exactly the same value for every assignment of numbers to the variables. For example, `a-(b-c)` becomes `a-b+c`.
Loading the problem…
More Oracle interview questions
- Multi-Head Attention from Scratch
- System Design — Event Ingestion + Top-K Aggregation
- OOD — File Management System
- Two-Stack FIFO Queue with Amortized O(1) Operations
- Evaluating an LLM Agent with Subjective, Nondeterministic Outputs
- Same N-ary Tree Comparison