leetCode记录
kingloon_oo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode —— 14. Longest Common Prefix解题思路
思路:先处理两种特殊情况: 1.如果需要判断的字符串集合strs为空,则直接返回结果“”; 2.如果需要判断的字符串集合strs中只要一个元素,则最长公共前缀即为该元素本身,直接返回该元素即可; 一般情况: 先遍历一遍字符串数组strs,找到最短的一个字符串shortestStr,以此为判断标准。每次取shortestStr的一个字串对字符串集合strs中的其它字符串进行前缀匹配,若匹原创 2017-12-13 21:04:45 · 421 阅读 · 0 评论 -
LeetCode —— 70. Climbing Stairs
题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will原创 2017-12-18 19:22:23 · 224 阅读 · 0 评论
分享