leetcode
最爱红色
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode-reverse words in a string
问题来源:https://oj.leetcode.com/problems/reverse-words-in-a-string/ Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the".原创 2014-08-09 11:08:51 · 753 阅读 · 0 评论 -
LeetCode中应用异或操作的几个题目
1.LeetCode 89题 Gray Code public List grayCode2(int n) { List result = new LinkedList<>(); for (int i = 0; i < 1 << n; i++){ result.add(i ^ i >> 1); } return result; } 2.LeetCode 136题 Single Nu原创 2017-08-07 13:02:16 · 1008 阅读 · 0 评论 -
leetcode 刷题总结
1 Two Sum 求数组中等于target的两个数的下标 数组 O(n*n) O(n),用HashMap存已遍历部分 2 Add Two Numbers 两数相加,数用链表表示,低位在头,高位在尾 链表 当l1、l2不为空或tmp不为0时,依次相加,得到tmp,tmp%10即当前位,tmp/10为进位 3 Longest Substring With原创 2017-10-28 17:27:54 · 568 阅读 · 0 评论
分享