中级农民
- 积分
- 104
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2013-9-25
- 最后登录
- 1970-1-1
|
第十四天三题
Student Attendance Record II : dp on ProL and P, insert 'A' to n-1 length string ( PorL[i] * PorL[n-1-i] )
Lowest Common Ancestor of a Binary Tree: dfs, find two paths to two nodes using preorder traversal with stack or dequeue ( or use hashmap to record parents of the nodes, find two nodes and find their common parents using the map, then dfs can be easier to write, normal recursion should work )
Expressive Words: push char, count of S into a vector, process each word and compare with the vector |
|