排序:
默认
按更新时间
按访问量

数组:Remove Element&Merge Sorted Array&First Missing Positive

Remove Element public int removeElement(int[] nums, int val) { int count = 0; for(int i=0;i<nums.length;i++){ if(nu...

2015-10-22 11:42:29

阅读数:231

评论数:0

遍历技巧:2,3,4sum&3sum closest&set matrix zeroes&Container With Most Water

2 sum public class Solution { public int[] twoSum(int[] nums, int target) { int[] res = new int[2]; HashMap map = new HashMap()...

2015-10-21 09:31:36

阅读数:240

评论数:0

Median of Two Sorted Arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity...

2015-10-05 08:27:17

阅读数:184

评论数:0

Candy

There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following ...

2015-10-02 06:38:41

阅读数:188

评论数:0

Regular Expression Matching

Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding elem...

2015-10-02 06:34:14

阅读数:133

评论数:0

Best Time to Buy and Sell Stock IV

Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may co...

2015-10-02 06:21:58

阅读数:200

评论数:0

Minimum Window Substring

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = &qu...

2015-10-02 06:14:05

阅读数:121

评论数:0

Dungeon Game

https://leetcode.com/problems/dungeon-game/ public class Solution { public int calculateMinimumHP(int[][] dungeon) { if (dungeon == null ...

2015-10-02 06:03:04

阅读数:154

评论数:0

Expression Add Operators

Given a string that contains only digits 0-9 and a target value, return all possibilities to add binaryoperators (not unary) +, -, or * between t...

2015-10-02 05:57:47

阅读数:179

评论数:0

Shortest Palindrome

Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can ...

2015-10-02 05:48:01

阅读数:131

评论数:0

Wildcard matching

Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (includin...

2015-10-02 04:30:18

阅读数:140

评论数:0

word search II

Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially ...

2015-09-30 23:49:28

阅读数:140

评论数:0

LRU cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get...

2015-09-30 23:26:39

阅读数:131

评论数:0

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 ...

2015-09-28 03:23:59

阅读数:121

评论数:0

Word Ladder II(BFS + DFS)

Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such t...

2015-09-28 02:55:17

阅读数:185

评论数:0

Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. /* * A line is determined by two factors,sa...

2015-09-27 23:44:03

阅读数:209

评论数:0

Valid Number

public class Solution { public boolean isNumber(String s) { s = s.trim(); boolean pointSeen = false; boolean eSeen = false; bool...

2015-09-27 21:25:30

阅读数:199

评论数:0

Longest Consecutive Sequence

Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], Th...

2015-09-27 11:38:48

阅读数:121

评论数:0

Fraction to Recurring Decimal

Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repea...

2015-09-27 11:14:09

阅读数:138

评论数:0

Surrounded Regions

Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that su...

2015-09-27 10:44:49

阅读数:117

评论数:0

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