- 博客(9)
- 收藏
- 关注
原创 [leetCode] Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest
2014-12-28 07:55:42 390
原创 [leetCode] Find Minimum in Rotated Sorted Array I & II
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). Find the minimum element. You may assume no duplicate exists in
2014-12-28 06:47:50 301
原创 [leetCode] Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 elements
2014-12-28 05:43:30 452
原创 [leetCode] Compare Version Numbers
Compare two version numbers version1 and version1. If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and co
2014-12-28 02:02:00 292
原创 [LeetCode] Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB Credits
2014-12-28 01:26:19 501
原创 [LeetCode] Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element
2014-12-23 01:38:04 347
原创 [leetCode] Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A: a1 → a2 ↘
2014-12-09 01:48:40 316
原创 [LeetCode] Sum Root to Leaf Numbers
Given 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 represents the number 123. Find the tota
2014-12-06 12:31:08 336
原创 [LeetCode] Find Peak Element
A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its index. You may imagine that num[-1] = num[n] = -
2014-12-06 02:36:45 496
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人