摘要:
基础题注意要bug free看清楚细节得public class Solution { public ListNode removeElements(ListNode head, int val) { if(head==null ) return null; Lis... 阅读全文
posted @ 2015-04-24 00:41
世界到处都是小星星
阅读(115)
评论(0)
推荐(0)
摘要:
/** * Definition for a point. * class Point { * int x; * int y; * Point() { x = 0; y = 0; } * Point(int a, int b) { x = a; y = b; } * ... 阅读全文
posted @ 2015-04-23 14:05
世界到处都是小星星
阅读(125)
评论(0)
推荐(0)
摘要:
摘抄自http://www.cnblogs.com/springfor/p/3870801.html“这道题运用位运算的异或。异或是相同为0,不同为1。所以对所有数进行异或,得出的那个数就是single number。初始时先让一个数与0异或,然后再对剩下读数挨个进行异或。这里运用到异或的性质:对于... 阅读全文
posted @ 2015-04-23 11:46
世界到处都是小星星
阅读(161)
评论(0)
推荐(0)
摘要:
http://blog.csdn.net/linhuanmars/article/details/20187257http://blog.csdn.net/dongtingzhizi/article/details/8236181塞翁失马焉知非福---4/22/2014 阅读全文
posted @ 2015-04-23 11:16
世界到处都是小星星
阅读(194)
评论(0)
推荐(0)
摘要:
refhttp://www.cnblogs.com/springfor/p/3874667.html高亮处"如果一个sorted word是在HashMap里面存在过的,说明这个词肯定是个变形词,除了把这个词加入到返回结果中,还需要把之前第一个存进HashMap里面的value存入result中。"... 阅读全文
posted @ 2015-04-23 04:50
世界到处都是小星星
阅读(144)
评论(0)
推荐(0)
摘要:
经典题refhttp://blog.csdn.net/u011095253/article/details/9158473public class Solution { public ArrayList solveNQueens(int n) { ArrayList res = ... 阅读全文
posted @ 2015-04-22 11:30
世界到处都是小星星
阅读(130)
评论(0)
推荐(0)
摘要:
最后一个block部分不一样,此外,helper最后的return true要想一想,小莹子的解释很好“对整个棋盘所有'.'都填完了,那么就可以返回true了。”public class Solution { public void solveSudoku(char[][] board) { ... 阅读全文
posted @ 2015-04-22 08:29
世界到处都是小星星
阅读(126)
评论(0)
推荐(0)
摘要:
最后一个循环的问题比较值得学习,本质是n皇后public class Solution { public boolean isValidSudoku(char[][] board) { //http://blog.csdn.net/linhuanmars/article/deta... 阅读全文
posted @ 2015-04-22 07:48
世界到处都是小星星
阅读(114)
评论(0)
推荐(0)
摘要:
压力太大了,这道题先不做了public class Solution { public String minWindow(String S, String T) { // 讲解http://articles.leetcode.com/2010/11/finding-minimum... 阅读全文
posted @ 2015-04-22 04:53
世界到处都是小星星
阅读(252)
评论(0)
推荐(0)
摘要:
滑动窗口,但是很繁琐 public class Solution { public ArrayList findSubstring(String S, String[] L) { //http://www.cnblogs.com/springfor/p/3872516.html ... 阅读全文
posted @ 2015-04-21 07:43
世界到处都是小星星
阅读(233)
评论(0)
推荐(0)
浙公网安备 33010602011771号