自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

西施豆腐渣

leetcode solutions by java, c++ and python

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

原创 leetcode 90: Search a 2D Matrix

Search a 2D MatrixApr 7 '12Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from

2013-02-26 09:03:12 669

原创 leetcode 89: Path Sum

Path SumOct 14 '12Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the

2013-02-26 05:59:17 1345

原创 leetcode 88: Next Permutation

Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lo

2013-02-23 17:52:51 1739

原创 leetcode 87: Word Ladder II

Word Ladder II    leetcode 2

2013-02-22 10:29:17 2083

原创 leetcode 86: Sum Root to Leaf Numbers

Sum Root to Leaf Numbers2 daysGiven a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which rep

2013-02-22 05:38:20 1925

原创 leetocde 85: Longest Consecutive Sequence

Longest Consecutive SequenceFeb 14Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The lon

2013-02-22 04:27:39 1395

原创 leetcode 84: Word Ladder

Word LadderFeb 11Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at

2013-02-21 07:44:32 5139 2

原创 leetcode 83: Wildcard Matching

Wildcard MatchingMar 16 '12Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequ

2013-02-21 04:59:25 1718

原创 leetcode 82: Multiply String

Multiply StringsMar 12 '12Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.unc

2013-02-18 17:47:40 1307

原创 leetcode 81: Partition List

Partition ListApr 30 '12Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original rela

2013-02-18 12:27:38 1859

原创 leetcode 81: Spiral Matrix II

Spiral Matrix IIMar 28 '12Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following matri

2013-02-18 08:02:50 985

原创 leetcode 80: Spiral Matrix

Spiral MatrixMar 25 '12Given 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:[ [ 1, 2, 3 ]

2013-02-18 07:40:32 644

原创 leetcode 79: Populating Next Right Pointers in Each Node II

Populating Next Right Pointers in Each Node IIOct 28 '12Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your prev

2013-02-17 17:16:46 616

原创 leetcode 78: Populating Next Right Pointers in Each Node

Populating Next Right Pointers in Each NodeOct 28 '12Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }

2013-02-17 17:00:41 530

原创 leetcode 77: Sort Colors

Sort ColorsApr 9 '12Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.H

2013-02-17 14:29:59 603

原创 leetcode 76: Reverse Linked List II

Reverse Linked List IIJun 27 '12Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->

2013-02-17 10:35:18 759

原创 leetcode 75: Reverse digits of an integer.

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Have you thought about this?Here are some good questions to ask before coding. Bonus points for you i

2013-02-16 14:44:02 3471

原创 leetcode 74: Permutation Sequence

Permutation SequenceMar 28 '12The 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 sequence (ie,

2013-02-14 16:02:37 2017

原创 leetcode 73: Longest Palindromic Substring

Longest Palindromic SubstringNov 11 '11Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longe

2013-02-14 09:32:05 904

原创 leetcode 72: N-Queens

N-QueensMar 20 '12The 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 all distinct sol

2013-02-14 07:52:14 825

原创 leetcode 71: Substring with Concatenation of All Words

Substring with Concatenation of All WordsFeb 24 '12You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that

2013-02-13 05:14:04 759

原创 leetcode 70: Rotate List

Rotate ListMar 28 '12Given 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,return 4->5->1->2->3->NULL.

2013-02-11 11:19:22 461

原创 leetcode 69: Combinations

Apr 18 '12Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2

2013-02-10 05:38:38 1887

原创 G10: longest palindrome or every palindrome

Write a program that prints all the sub string that is palindrome within a input String. For e.g For input String "abbcacbca" output should be: [cac, bcacb, cbc, acbca, bb]URL:  question?id=9689

2013-02-08 15:57:58 398

原创 denim1: sum of subsets

Given a target value and a list of numbers to pick from, pick numbers from the list such that thenumbers picked add up to the target value.  package careercup;import java.util.ArrayList;imp

2013-02-07 07:19:12 586

原创 leetcode 68: Interleaving String

leetcode 68 Interleaving String

2013-02-05 08:29:53 1158

原创 leetcode 67: Rotate Image

Rotate ImageMar 18 '12You 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?public class

2013-02-05 07:05:50 1104

空空如也

空空如也

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

TA关注的人

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