JasonChang

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 18 下一页

2013年11月19日

摘要: 1 public class Solution { 2 public ListNode reverseKGroup(ListNode head, int k) { 3 // Start typing your Java solution below 4 // DO NOT write main() function 5 6 if(head == null || k == 1) 7 return head; 8 9 int len = 0;10 ... 阅读全文
posted @ 2013-11-19 16:44 JasonChang 阅读(157) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public int jump(int[] A) { 3 if(A == null){ 4 return 0; 5 } 6 int len = A.length; 7 if(len == 0 || len == 1){ 8 return 0; 9 }10 11 int cur = 0;12 int next = 0;13 int ret =... 阅读全文
posted @ 2013-11-19 16:07 JasonChang 阅读(134) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList> combinationSum2(int[] num, int target) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 HashSet> result = new HashSet>(); 6 ArrayList... 阅读全文
posted @ 2013-11-19 15:26 JasonChang 阅读(153) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public int totalNQueens(int n) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList result = new ArrayList(); 6 int depth = 0; 7 int[] ro... 阅读全文
posted @ 2013-11-19 13:36 JasonChang 阅读(167) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public static ArrayList solveNQueens(int n) { 3 // Start typing your Java solution below 4 // DO NOT write main() function 5 ArrayList result = new ArrayList(); 6 int depth = 0; 7 int[] rows = new int[n]; 8 for (int i =... 阅读全文
posted @ 2013-11-19 13:29 JasonChang 阅读(145) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ListNode insertionSortList(ListNode head) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ListNode prehead = new ListNode(0); 6 ListNode runner... 阅读全文
posted @ 2013-11-19 13:20 JasonChang 阅读(168) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList> combinationSum(int[] candidates, int target) { 3 // Start typing your Java solution below 4 // DO NOT write main() function 5 ArrayList> result = new ArrayList>(); 6 int len = candidates.length, depth = 0; 7 i... 阅读全文
posted @ 2013-11-19 13:07 JasonChang 阅读(124) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public void nextPermutation(int[] num) { 3 // Note: The Solution object is instantiated only once and is reused by each test case. 4 int length = num.length; 5 int index = - 1; 6 for(int i = length - 1; i >= 1; i--){ 7 if(n... 阅读全文
posted @ 2013-11-19 12:46 JasonChang 阅读(201) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList> permuteUnique(int[] num) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 int len = num.length; 6 ArrayList> result = new ArrayList>(... 阅读全文
posted @ 2013-11-19 12:36 JasonChang 阅读(198) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public int uniquePathsWithObstacles(int[][] obstacleGrid) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 int m = obstacleGrid.length; 6 int n = obsta... 阅读全文
posted @ 2013-11-19 12:25 JasonChang 阅读(149) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 18 下一页