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

CODE 134: Single Number II

Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtim...

2013-11-23 17:49:40

阅读数:412

评论数:0

CODE 133: Single Number

Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime c...

2013-11-23 16:52:37

阅读数:442

评论数:0

CODE 132: 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 followin...

2013-11-23 16:49:20

阅读数:536

评论数:0

CODE 131: Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it ...

2013-11-22 22:14:51

阅读数:461

评论数:0

CODE 6: Word Ladder II

Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be...

2013-11-19 23:01:13

阅读数:661

评论数:0

CODE 130: Clone Graph

Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes ar...

2013-11-18 23:51:32

阅读数:602

评论数:0

CODE 41: Reverse Linked List II

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

2013-11-17 14:46:58

阅读数:364

评论数:0

CODE 42: Subsets II

Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: Elements in a subset must be in non-desce...

2013-11-17 14:32:57

阅读数:515

评论数:0

CODE 51: Search in Rotated Sorted Array II

Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why?...

2013-11-17 14:13:20

阅读数:558

评论数:0

CODE 53: Remove Duplicates from Sorted Array II

Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array A = [1,1,1,2,2,3], You...

2013-11-17 14:06:58

阅读数:528

评论数:0

CODE 74: Spiral Matrix II

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

2013-11-16 21:13:34

阅读数:543

评论数:0

CODE 129: Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the t...

2013-11-16 20:47:11

阅读数:596

评论数:0

CODE 128: Median of Two Sorted Arrays

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

2013-11-15 22:15:27

阅读数:374

评论数:0

CODE 127: Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...

2013-11-14 20:50:35

阅读数:548

评论数:0

CODE 126: Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single...

2013-11-14 20:39:12

阅读数:528

评论数:0

CODE 125: Longest Palindromic Substring

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

2013-11-14 20:13:23

阅读数:563

评论数:0

CODE 124: ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in ...

2013-11-13 22:45:29

阅读数:369

评论数:0

CODE 123: Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? ...

2013-11-12 21:24:02

阅读数:588

评论数:0

CODE 122: String to Integer (atoi)

Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see be...

2013-11-12 21:04:14

阅读数:583

评论数:0

CODE 121: Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be pali...

2013-11-12 20:46:15

阅读数:601

评论数:0

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