forked from wisdompeak/LeetCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b5d432
commit 5ae4ccd
Showing
1 changed file
with
5 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### 736.Parse-Lisp-Expression | ||
|
||
本题不难,有足够的耐心就能做出来。对于比较复杂的规则,我们用递归应该比用栈更容易。因为“括号”天然就提示了递归了层次,而且这种算式字符串的解析,括号内外的规则都是完全一样的,非常适合用递归。 | ||
|
||
对于let语句,后面会跟着奇数个参数。除去最后一个参数,第奇数个参数一定是一个变量,第偶数个参数则可能是变量/数值/递归式。而对于最后一个参数(注意也是第奇数个参数),则同样可能是变量/数值/递归式。 |