GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing leetcode.cn — 736. Lisp 语法解析 - 力扣(LeetCode) 题目描述 题目描述 题解 题解 提交记录 提交记录 困难 给你一个类似 Lisp 语句的字符串表达式 表达式语法如下所示:
示例 1: 输入:expression = "(let x 2 (mult x (let x 3 y 4 (add x y))))" 输出:14 解释: 计算表达式 (add x y), 在检查变量 x 值时, 在变量的上下文中由最内层作用域依次向外检查。 首先找到 x = 3, 所以此处的 x 值是 3 。 示例 2: 输入:expression = "(let x 3 x 2 x)" 输出:2 解释:let 语句中的赋值运算按顺序处理即可。 示例 3: 输入:expression = "(let x 1 y 2 x (add x y) (add x y))" 输出:5 解释: 第一个 (add x y) 计算结果是 3,并且将此值赋给了 x 。 第二个 (add x y) 计算结果是 3 + 2 = 5 。 提示:
代码 代码 测试用例 测试用例 测试结果 测试结果 |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |