上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页

[LeetCode] 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 target valu... 阅读全文
posted @ 2013-01-04 13:23 小刀初试 阅读(141) 评论(0) 推荐(0)

[LeetCode] 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 in the ord... 阅读全文
posted @ 2013-01-04 11:36 小刀初试 阅读(125) 评论(0) 推荐(0)

[LeetCode] Scramble String 解题报告

摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio... 阅读全文
posted @ 2013-01-03 06:29 小刀初试 阅读(183) 评论(0) 推荐(0)

[LeetCode] 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,return 4->5->1->2->3->... 阅读全文
posted @ 2013-01-02 08:22 小刀初试 阅读(133) 评论(0) 推荐(0)

[LeetCode] 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?» Solve this pr... 阅读全文
posted @ 2013-01-02 07:49 小刀初试 阅读(103) 评论(0) 推荐(0)

[LeetCode] Roman To Integer 解题报告

摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.» Solve this problem[解题思路]从前往后扫描,用一个临时变量记录分段... 阅读全文
posted @ 2013-01-01 13:34 小刀初试 阅读(130) 评论(0) 推荐(0)

[LeetCode] 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 then le... 阅读全文
posted @ 2013-01-01 13:14 小刀初试 阅读(123) 评论(0) 推荐(0)

[LeetCode] 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 = 4,return 1->4->3->2->5... 阅读全文
posted @ 2013-01-01 08:47 小刀初试 阅读(153) 评论(0) 推荐(0)

[LeetCode] Reverse Integer 解题报告

摘要: Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are s... 阅读全文
posted @ 2013-01-01 07:52 小刀初试 阅读(161) 评论(0) 推荐(0)

[LeetCode] Restore IP Addresses 解题报告

摘要: Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255... 阅读全文
posted @ 2013-01-01 07:33 小刀初试 阅读(189) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页