摘要: Refer to some rules of regular expression.Code:public class Solution { public String simplifyPath(String path) { Stack pathStack = new Stack... 阅读全文
posted @ 2016-01-20 14:04 爱推理的骑士 阅读(126) 评论(0) 推荐(0) 编辑
摘要: We should keep in mind that never let the integer value overranged or overstacked..Here is the trick, instead of comparing the square of a interger wi... 阅读全文
posted @ 2016-01-20 12:12 爱推理的骑士 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Very similar to Unique Paths problem. Generate a 2D array to record the number of paths to the current position. Do the traverse and calculate job as ... 阅读全文
posted @ 2016-01-20 09:55 爱推理的骑士 阅读(134) 评论(0) 推荐(0) 编辑
摘要: first of all, we're goin to create a 2D array(int[][] grid) to store the number of paths to each position. we get the minimum value of m and n, mark i... 阅读全文
posted @ 2016-01-20 09:19 爱推理的骑士 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Use 3 pointers each of them points to the address of Head, The node before Tail and Tail node; When rotating the list step by step, tail.next = head; ... 阅读全文
posted @ 2016-01-20 06:44 爱推理的骑士 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Code:public class Solution { public static String getPermutation(int n, int k) { String result = ""; if(n == 1) return result + 1; ... 阅读全文
posted @ 2016-01-20 06:13 爱推理的骑士 阅读(106) 评论(0) 推荐(0) 编辑