摘要:
1. The score got is not original size of snake since starting score is 0 when snake size is 1. 2. Do not forget to add the head after check death.
阅读全文
posted @ 2016-07-01 04:49
keepshuatishuati
阅读(180)
推荐(0)
摘要:
1. check children is null or not.
阅读全文
posted @ 2016-06-30 06:50
keepshuatishuati
阅读(145)
推荐(0)
摘要:
1 class TrieNode { 2 // Initialize your data structure here. 3 TrieNode[] children = new TrieNode[26]; 4 boolean isWord; 5 public TrieNode() { 6 } 7 } 8 9 public class T...
阅读全文
posted @ 2016-06-30 06:04
keepshuatishuati
阅读(148)
推荐(0)
摘要:
DO NOT forget to move the end index one more. Otherwise, it will keep stucking in same vowel.
阅读全文
posted @ 2016-06-29 15:21
keepshuatishuati
阅读(125)
推荐(0)
摘要:
Last DP element MAY NOT be the answer since the max number can happened between.
阅读全文
posted @ 2016-06-29 15:10
keepshuatishuati
阅读(167)
推荐(0)
摘要:
Another solution is sort all the points and create another reflected points array. Sort again, then they should be same.
阅读全文
posted @ 2016-06-29 15:03
keepshuatishuati
阅读(134)
推荐(0)
摘要:
1. When n == 0, it return 1. 2. Since already make result = 10, count until 2.
阅读全文
posted @ 2016-06-29 14:57
keepshuatishuati
阅读(125)
推荐(0)
摘要:
1 public class Solution { 2 public List largestDivisibleSubset(int[] nums) { 3 List result = new ArrayList(); 4 if (nums.length == 0) { 5 return result; 6 ...
阅读全文
posted @ 2016-06-29 14:43
keepshuatishuati
阅读(227)
推荐(0)
摘要:
1. Do not need to update all the element from i to j. Since it starts with all 0 array. We can simple use start and end as the mark, sum all the value
阅读全文
posted @ 2016-06-29 14:24
keepshuatishuati
阅读(149)
推荐(0)
摘要:
1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ListNode next; 6 * ListNode(int x) { val = x; } 7 * } 8 */ 9 public class Solutio...
阅读全文
posted @ 2016-06-29 13:50
keepshuatishuati
阅读(162)
推荐(0)