Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t...
分类:
其他好文 时间:
2014-11-25 10:46:27
阅读次数:
196
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs...
分类:
其他好文 时间:
2014-11-24 11:30:48
阅读次数:
161
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example,S = "ADOBECOD...
# 题目 > Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "B...
分类:
其他好文 时间:
2014-11-23 23:36:47
阅读次数:
411
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes...
分类:
其他好文 时间:
2014-11-23 23:08:31
阅读次数:
339
题目The minimum square sumTime Limit 1000msMemory Limit 65536Kdescription Given a prime p (pint main(){long long int i,j,k,n,m;while(scanf("%lld",&n)!=....
分类:
其他好文 时间:
2014-11-22 20:15:41
阅读次数:
198
Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort...
分类:
其他好文 时间:
2014-11-22 20:07:33
阅读次数:
154
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2014-11-22 14:45:18
阅读次数:
141
Problem StatementGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindr...
分类:
其他好文 时间:
2014-11-22 13:20:44
阅读次数:
301
Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?前面那道题:Find ...
分类:
其他好文 时间:
2014-11-22 11:59:28
阅读次数:
162