自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 CODE 100: Search in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a ...

2013-10-31 22:25:17 413 0

原创 CODE 99: Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be ...

2013-10-31 21:57:07 394 0

原创 CODE 98: Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in o...

2013-10-30 22:59:11 363 0

原创 CODE 97: Valid Sudoku

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled...

2013-10-30 22:32:20 554 0

原创 CODE 96: Sudoku Solver

Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may assume t...

2013-10-29 22:05:06 354 0

原创 CODE 95: Count and Say

The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 1...

2013-10-29 20:47:45 469 0

原创 CODE 93: Combination Sum II

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Ea...

2013-10-28 21:30:20 448 0

原创 CODE 94: Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same ...

2013-10-28 21:11:00 406 0

原创 CODE 92: First Missing Positive

Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your ...

2013-10-28 19:25:31 493 0

原创 CODE 91: Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining...

2013-10-27 22:20:33 464 0

原创 CODE 90: Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non...

2013-10-27 19:38:08 424 0

转载 无题

点击打开链接 ------------------------------------------------------------------------------------  后面是9月份以前默默的自己瞎写的内容,那时候还不知道找工作会遇到什么,哎呀,不舍得删  ---...

2013-10-27 16:15:38 589 0

原创 CODE 89: Wildcard Matching

Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matc...

2013-10-27 11:03:54 520 0

原创 CODE 88: Jump Game II

Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your m...

2013-10-20 21:46:52 502 0

原创 CODE 86: Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the following uni...

2013-10-20 15:43:32 456 0

原创 CODE 87: Permutations

Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3]...

2013-10-20 15:29:24 407 0

原创 CODE 85: Rotate Image

You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? ...

2013-10-19 00:28:46 478 0

原创 CODE 84: Anagrams

Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. public ArrayList anagrams...

2013-10-18 21:52:12 445 0

转载 转一篇有关JAVA的内存泄露的文章

http://www.lybbs.net/news_read.do?newsPath=2007/9/25/1190684628458.html   1 引言      Java的一个重要优点就是通过垃圾收集器GC (Garbage Collection)自动管理内存的回收,程序员不需要通...

2013-10-17 19:27:14 438 0

原创 CODE 83: Pow(x, n)

Implement pow(x, n). public double pow(double x, int n) { // Note: The Solution object is instantiated only once and is reused by // each tes...

2013-10-16 23:17:57 673 0

原创 CODE 81: N-Queens II

Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. public int ...

2013-10-16 22:41:02 586 0

原创 CODE 82: N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return al...

2013-10-16 19:33:03 524 0

原创 CODE 80: Maximum Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−...

2013-10-13 22:07:19 423 0

原创 CODE 79: Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix:...

2013-10-12 23:11:27 479 0

原创 CODE 78: Jump Game

Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your m...

2013-10-11 21:53:04 418 0

原创 CODE 76: Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were in...

2013-10-11 20:22:05 388 0

原创 CODE 77: Merge Intervals

Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. ...

2013-10-10 23:20:18 426 0

原创 CODE 75: Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If ...

2013-10-10 21:32:13 429 0

原创 CODE 73: Permutation Sequence

The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following ...

2013-10-09 19:41:45 416 0

原创 CODE 72: Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2,...

2013-10-09 00:06:37 413 0

原创 CODE 70: Unique Paths II

Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacl...

2013-10-07 23:22:17 1004 0

原创 CODE 71: Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or ...

2013-10-07 22:36:05 495 0

原创 CODE 69: Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path....

2013-10-07 22:13:22 507 0

原创 CODE 68: Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. p...

2013-10-07 20:07:42 466 0

原创 CODE 67: Add Binary

Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". ...

2013-10-07 19:59:34 516 0

原创 CODE 66: Valid Number

Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 ...

2013-10-07 19:34:22 617 0

原创 CODE 65: Plus One

Given a number represented as an array of digits, plus one to the number. public int[] plusOne(int[] digits) { // Start typing your Java soluti...

2013-10-07 15:37:17 564 0

原创 CODE 64: Text Justification

Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You ...

2013-10-07 11:37:23 467 0

原创 CODE 63: Sqrt(x)

Implement int sqrt(int x). Compute and return the square root of x. public int sqrt(int x) { // Note: The Solution object is instantiated ...

2013-10-06 17:19:33 427 0

原创 CODE 62: Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can yo...

2013-10-06 17:05:50 520 0

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