- 博客(48)
- 资源 (1)
- 收藏
- 关注
原创 CODE 11: Best Time to Buy and Sell Stock II
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 complete as many transactions as you like (ie, buy on
2013-09-15 16:56:50 843
原创 CODE 12: Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),
2013-09-15 16:55:55 763
原创 CODE 8: Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a pa
2013-09-12 22:13:27 661
原创 CODE 7: Word Ladder
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter can be changed at a time Each intermediate word
2013-09-12 00:05:40 659
原创 CODE 5: 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], The longest consecutive elements sequence is [1, 2, 3,
2013-09-10 22:28:57 530
原创 CODE 4: 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 total sum
2013-09-09 22:47:01 667
原创 CODE 3: 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 surrounded region . For example, X X X X X O O X X X O
2013-09-09 21:30:24 684 1
原创 CODE 1: Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab", Return 1 s
2013-09-08 15:08:02 540 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人