摘要:
Refer to some rules of regular expression.Code:public class Solution { public String simplifyPath(String path) { Stack pathStack = new Stack... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
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; ... 阅读全文
摘要:
Code:public class Solution { public static String getPermutation(int n, int k) { String result = ""; if(n == 1) return result + 1; ... 阅读全文