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

CODE 120: Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two ...

2013-11-10 15:54:04

阅读数:387

评论数:0

CODE 119: Integer to Roman

Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. static List r2a = new ArrayList(...

2013-11-10 14:19:44

阅读数:358

评论数:0

CODE 118: Roman to Integer

Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. static Map r2a = new HashMap(); ...

2013-11-10 12:19:02

阅读数:505

评论数:0

CODE 117: Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. public String longestCommonPrefix(String[] strs) { // St...

2013-11-09 22:28:32

阅读数:552

评论数:0

CODE 114: 4Sum

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array w...

2013-11-09 21:15:05

阅读数:583

评论数:0

CODE 115: 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers...

2013-11-08 22:32:29

阅读数:342

评论数:0

CODE 116: 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum o...

2013-11-08 21:23:19

阅读数:326

评论数:0

CODE 113: Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telep...

2013-11-06 21:49:32

阅读数:478

评论数:0

CODE 112: Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, ...

2013-11-06 20:23:28

阅读数:447

评论数:0

CODE 111: Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i...

2013-11-06 19:51:53

阅读数:537

评论数:0

CODE 110: Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set i...

2013-11-05 21:26:28

阅读数:479

评论数:0

CODE 109: Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. public ListNode mergeKLists(ArrayList lists)...

2013-11-05 19:48:01

阅读数:337

评论数:0

CODE 108: Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2-&...

2013-11-04 20:32:03

阅读数:472

评论数:0

CODE 107: Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k th...

2013-11-04 20:19:47

阅读数:530

评论数:0

CODE 106: Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra spac...

2013-11-04 19:43:49

阅读数:498

评论数:0

CODE 105: Remove Element

Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn'...

2013-11-03 18:59:17

阅读数:451

评论数:0

CODE 104: Divide Two Integers

Divide two integers without using multiplication, division and mod operator. public int divide(int dividend, int divisor) { // IMPORTANT: Pleas...

2013-11-03 16:35:51

阅读数:455

评论数:0

CODE 103: Substring with Concatenation of All Words

You 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 is a concaten...

2013-11-03 14:28:21

阅读数:413

评论数:0

CODE 102: Next Permutation

public void nextPermutation(int[] num) { // IMPORTANT: Please reset any member data you declared, as // the same Solution instance will be reused...

2013-11-01 23:10:05

阅读数:400

评论数:0

CODE 101: Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()...

2013-11-01 22:28:45

阅读数:327

评论数:0

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