自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

调包侠

做一个德艺双馨的调包侠~

  • 博客(27)
  • 收藏
  • 关注

原创 LeetCode 229 --- Majority Element II

题目链接: LeetCode 229 — Majority Element IIAC代码:public class Problem229 { public static void main(String[] args) { // TODO Auto-generated method stub int[] name ={1,1,1,2,3}; m

2017-02-21 19:03:49 313

原创 LeetCode 90 --- Subsets II

题目链接: LeetCode 90 — Subsets IIAC代码:public class Problem90 { public static void main(String[] args) { // TODO Auto-generated method stub } public List<List<Integer>> subsetsWithDup(in

2017-02-21 17:13:15 346

转载 LeetCode 88 --- Merge Sorted Array

问题链接:LeetCode 88 — Merge Sorted ArrayAC代码:public class Problem88 { public static void main(String[] args) { // TODO Auto-generated method stub } //参考 https://discuss.leetcode.com/topi

2017-02-21 17:11:39 268

原创 LeetCode 80 --- Remove Duplicates from Sorted Array II

题目链接: LeetCode 80 — Remove Duplicates from Sorted Array IIAC代码:public class Problem80 { public static void main(String[] args) { // TODO Auto-generated method stub } public int remov

2017-02-21 17:09:38 228

原创 LeetCode 78 --- Subsets

题目链接: LeetCode 78 — SubsetsAC代码:public class Problem78 { public static void main(String[] args) { // TODO Auto-generated method stub } public List<List<Integer>> subsets(int[] nums)

2017-02-21 17:07:43 225

原创 LeetCode 75 --- Sort Colors

题目链接: LeetCode 75 — Sort ColorsAC代码:public class Problem75 { public static void main(String[] args) { // TODO Auto-generated method stub } public class Solution { public void

2017-02-21 17:06:37 269

原创 LeetCode 74 --- Search a 2D Matrix

题目链接:LeetCode 74 — Search a 2D MatrixAC代码:public class Problem74 { public static void main(String[] args) { } // TODO Auto-generated method stub public boolean searchMatrix(int[][] ma

2017-02-21 17:04:51 362

原创 LeetCode 73 --- Set Matrix Zeroes

题目链接: LeetCode 73 — Set Matrix ZeroesAC代码:public class Problem73 { public static void main(String[] args) { // TODO Auto-generated method stub } public void setZeroes(int[][] matrix

2017-02-21 17:03:06 238

原创 LeetCode 66 --- Plus One

题目链接: AC代码:public class Problem66 { public static void main(String[] args) { // TODO Auto-generated method stub } public int[] plusOne(int[] digits) { for(int i=digits.length-1

2017-02-21 17:01:27 186

原创 LeetCode 64 --- Minimum Path Sum

题目链接: LeetCode 64 — Minimum Path SumAC代码:public class Problem64 { public static void main(String[] args) { // TODO Auto-generated method stub } public int minPathSum(int[][] grid) {

2017-02-19 20:59:32 190

原创 LeetCode 63 --- Unique Paths II

题目链接: LeetCode 63 — Unique Paths IIAC代码:public class Problem63 { public static void main(String[] args) { // TODO Auto-generated method stub } public int uniquePathsWithObstacles(int

2017-02-19 20:47:20 169

原创 LeetCode 62 --- Unique Paths

题目链接: LeetCode 62 — Unique Paths问题分析: 简单dp。AC代码:public class Problem62 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(uniquePaths(5

2017-02-19 20:22:56 193

转载 LeetCode 59 --- Spiral Matrix II

题目链接: LeetCode 59 — Spiral Matrix IIAC代码:public class Problem59 { public static void main(String[] args) { // TODO Auto-generated method stub } //参考https://discuss.leetcode.com/topic

2017-02-19 20:20:23 201

原创 LeetCode 57 --- Insert Interval

题目链接: LeetCode 57 — Insert IntervalAC代码:public class Problem57 { public static void main(String[] args) { List <Interval> list =new ArrayList<Interval>(); list.add(new Interval(0,2

2017-02-19 20:18:42 237

原创 LeetCode 56 --- Merge Intervals

题目链接: LeetCode 56 — Merge IntervalsAC代码:class Interval { int start; int end; Interval() { start = 0; end = 0; } Interval(int s, int e) { start = s; end = e; } @Override p

2017-02-19 20:17:07 253

原创 LeetCode 55 --- Jump Game

题目链接: LeetCode 55 — Jump GameAC代码:public class Problem55 { public static void main(String[] args) { // TODO Auto-generated method stub } public boolean canJump(int[] nums) {

2017-02-19 20:15:42 176

转载 LeetCode 54 --- Spiral Matrix

题目链接: LeetCode 54 — Spiral MatrixAC代码://参考 https://discuss.leetcode.com/topic/64099/easy-java-solution-with-explainationpublic class Problem54 { public static void main(String[] args) { /

2017-02-19 20:14:17 222

转载 LeetCode 53 --- Maximum Subarray

题目链接: LeetCode 53 — Maximum SubarrayAC代码:public class Problem53 { public static void main(String[] args) { // TODO Auto-generated method stub } public int maxSubArray(int[] nums) {

2017-02-19 20:12:42 167

原创 LeetCode 495 --- Teemo Attacking

题目链接: LeetCode 495 — Teemo AttackingAC代码:public class Problem495 { public static void main(String[] args) { // TODO Auto-generated method stub int[] name={1,2}; System.out.p

2017-02-19 20:10:45 678

原创 LeetCode 485 --- Max Consecutive Ones

题目链接: LeetCode 485 — Max Consecutive OnesAC代码:public class Problem485 { public static void main(String[] args) { // TODO Auto-generated method stub int[] name={1,1,0,1,1,1};

2017-02-19 20:09:18 352

原创 LeetCode 48 --- Rotate Image

题目链接: LeetCode 48 — Rotate ImageAC代码:public class Problem48 { public static void main(String[] args) { // TODO Auto-generated method stub int [][] ss={{1,2},{3,4}}; rotate(s

2017-02-19 20:07:11 219

原创 LeetCode 45 --- Jump Game II

题目链接: LeetCode 45 — Jump Game IIAC代码:public class Problem45 { public static void main(String[] args) { // TODO Auto-generated method stub } public int jump(int[] nums) { if(n

2017-02-19 20:05:41 198

原创 LeetCode 448 --- Find All Numbers Disappeared in an Array

题目链接: LeetCode 448 — Find All Numbers Disappeared in an ArrayAC代码:public class Problem448 { public static void main(String[] args) { int [] a={4,3,2,7,8,2,3,1}; // TODO Auto-generat

2017-02-19 20:03:31 192

原创 LeetCode 442 --- Find All Duplicates in an Array

题目链接: LeetCode 442 — Find All Duplicates in an Array问题分析: 需要o(n)的时间复杂度并且不能使用额外的存储空间。找出数组中的重复元素。AC代码:public class Problem442 { public static void main(String[] args) { // TODO Auto-generat

2017-02-19 19:53:49 678

原创 LeetCode 42 --- Trapping Rain Water

题目链接: LeetCode 42 — Trapping Rain Water问题分析: 贪心思路,很简单。AC代码:public class Problem42 { public static void main(String[] args) { // TODO Auto-generated method stub\ int[] a={};

2017-02-19 19:47:33 172

原创 LeetCode 414 --- Third Maximum Number

题目链接: LeetCode 414 — Third Maximum NumberAC代码:public class Problem414 { public static void main(String[] args) { // TODO Auto-generated method stub int[] aa={2,2,3,1}; thir

2017-02-19 19:41:41 203

原创 LeetCode 169 --- Majority Element

题目链接: LeetCode 169 — Majority Element AC代码:public class Problem169 { public int majorityElement(int[] nums) { int m=nums[0],n=0; for(int i=0;i<nums.length;i++){ if(num

2017-02-19 19:37:29 179

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除