自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

调包侠

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

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

原创 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 312

原创 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 344

转载 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 264

原创 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 227

原创 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 267

原创 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 361

原创 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 185

原创 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 676

原创 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 351

原创 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 218

原创 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 178

原创 Kaggle -- Shelter Animal Outcomes

最近在Kaggle上做了一个数据挖掘的比赛,是一个分类的问题,收获良多。故此将比赛的过程记录了下来。竞赛地址Kaggle–Shelter Animal Outcomes题目大意  在美国,每年大约有760万伴侣动物被动物收容所收容。大多数动物是被它们的主人主动放弃,而另一些则是由于种种的意外情况而进入收容所。最终,有些动物足够幸运找到了新的归宿,但另一些不那么幸运的则最终被安乐死。美国每年大约有27

2017-01-03 23:44:53 5205 1

原创 LeetCode 41---First Missing Positive

题目链接: LeetCode 41—First Missing Positive AC代码:public class Problem41 { public static void main(String[] args) { // TODO Auto-generated method stub int[] a={1}; System.out.p

2016-12-28 22:10:24 513 1

原创 LeetCode 40---Combination Sum II

题目链接如下: LeetCode 40—Combination Sum IIAC代码如下:import java.util.ArrayList;import java.util.Arrays;import java.util.List;public class Problem40 { public static void main(String[] args) { int

2016-12-28 22:07:56 212

转载 LeetCode 4---Median of Two Sorted Arrays

题目链接: 转载自:http://www.lxway.com/49629084.htm AC代码如下:、public class Problem4 { public static void main(String[] args) { // TODO Auto-generated method stub int[] nums1={1,3}; i

2016-12-28 22:06:06 164

原创 LeetCode 39---Combination Sum

题目链接:LeetCode 39—Combination SumAC代码:import java.util.ArrayList;import java.util.Arrays;import java.util.List;public class Problem39 { public static void main(String[] args) { int[] ss={2,

2016-12-28 22:03:22 151

原创 LeetCode 380---Insert Delete GetRandom O(1)

题目链接: LeetCode 380—Insert Delete GetRandom O(1)AC代码:package com.leetcode.arrays;import java.util.ArrayList;import java.util.HashMap;import java.util.Random;public class Problem380 { HashMap<Integ

2016-12-28 22:00:57 228

原创 LeetCode 381---Insert Delete GetRandom O(1) - Duplicates allowed

题目链接:LeetCode 381—Insert Delete GetRandom O(1) - Duplicates allowed AC代码:import java.util.ArrayList;import java.util.HashMap;import java.util.HashSet;import java.util.List;import java.util.Map;i

2016-12-28 21:56:31 221

原创 LeetCode 35---Search Insert Position

题目链接:LeetCode 35—Search Insert PositionAC代码:public class Problem35 {public static void main(String[] args) { // TODO Auto-generated method stub}public int searchInsert(int[] nums, int target) {

2016-12-28 21:53:55 302 2

原创 LeetCode 34---Search for a Range

题目链接: LeetCode 34—Search for a RangeAC代码:`public class Problem34 {public static void main(String[] args) { // TODO Auto-generated method stub}public int[] searchRange(int[] nums, int target) {

2016-12-28 21:49:28 183

原创 LeetCode 33---Search in Rotated Sorted Array

*题目链接: * LeetCode 33—Search in Rotated Sorted ArrayAC代码:public class Problem33 { public static void main(String[] args) { // TODO Auto-generated method stub int[] ss={4,5,1,2,3};

2016-12-28 21:44:51 268 1

原创 LeetCode 31---Next Permutation

题目链接:LeetCode 31—Next Permutation题目大意:给定数组组成一个整数,要找出仍然由这些数字组成的另一个整数比原整数大且最接近的一个数,如果这个数已然是最大的一个数了就求出最小的数。解法:一个模拟的问题,AC代码如下:public class Problem31 { public static void main(String[] args) { /

2016-12-28 21:20:41 321 2

转载 LeetCode 289---Game of Life

问题描述:LeetCode 289—Game of Life实现代码:public class Problem289 { public static void main(String[] args) { // TODO Auto-generated method stub } // 参考 https://discuss.leetcode.com/topic/654

2016-12-23 15:36:30 328

原创 LeetCode 287---Find the Duplicate Number

问题链接:LeetCode 287—Find the Duplicate Number题目大意 : 找出序列中唯一一个重复出现的数字,且只能使用o(1)的额外空间 实现代码如下:public class Problem287 { public static void main(String[] args) { // TODO Auto-generated method stu

2016-12-23 15:34:21 195

空空如也

空空如也

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

TA关注的人

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