// Given a string representing an arithmetic expression with only addition and
// multiplication operators, return the result of the calculation.
//
// For example, for "2*3+4", return 10
这题要求实现简化版表达式求值器,只有 + 和 *,考点是运算符优先级:乘法先算,再与加法结合。典型做法是用一个栈记录部分乘积,或单次扫描中维护当前乘法块的累积值。
VOprep 团队长期陪同学员实战各类大厂 OA 与 VO,包括 Meta、Google、Amazon 等,提供实时答案助攻、远程陪练与面试节奏提醒,帮助大家在关键时刻不卡壳。
如果你也在准备 Stripe 或类似工程向公司,可以了解一下我们的定制助攻方案——从编程面到系统设计,全程护航上岸。
正文完