11 2014 档案

摘要:Problem StatementGiven two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1... 阅读全文
posted @ 2014-11-30 09:57 kid551 阅读(172) 评论(0) 推荐(0) 编辑
摘要:Problem Statement描述 一日,崔克茜来到小马镇表演魔法。其中有一个节目是开锁咒:舞台上有 n 个盒子,每个盒子中有一把钥匙,对于每个盒子而言有且仅有一把钥匙能打开它。初始时,崔克茜将会随机地选择 k 个盒子用魔法将它们打开。崔克茜想知道最后所有盒子都被打开的概率,你能帮助她回答这个问... 阅读全文
posted @ 2014-11-24 15:33 kid551 阅读(365) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2014-11-22 12:02 kid551 阅读(119) 评论(0) 推荐(0) 编辑
摘要:My naive O(n2) running time solution:class Solution {public: int jump(int A[], int n) { if(1 == n) return 0; int maxL = (1= (i-j) ... 阅读全文
posted @ 2014-11-22 01:32 kid551 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Problem StatementGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1,... 阅读全文
posted @ 2014-11-22 01:05 kid551 阅读(136) 评论(0) 推荐(0) 编辑
摘要:Loop List is very common in interview. This article we give a more strict shortstatement about its solving.One method to check if there's a loop in a ... 阅读全文
posted @ 2014-11-22 00:49 kid551 阅读(281) 评论(0) 推荐(0) 编辑
摘要:A fast method to determine the number is odd or even:total & 0x1 //true, if total is oddtotal & 0x1 //false, if total is evenProblem StatementThere ar... 阅读全文
posted @ 2014-11-21 19:48 kid551 阅读(257) 评论(0) 推荐(0) 编辑
摘要:Let'sbegin witha naive method.We first need to sort the array A[n]. And we want to solve the problem by iterating through A from beginning and ending.... 阅读全文
posted @ 2014-11-21 19:20 kid551 阅读(204) 评论(0) 推荐(0) 编辑
摘要:Problem StatementImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangeme... 阅读全文
posted @ 2014-11-21 16:51 kid551 阅读(168) 评论(0) 推荐(0) 编辑
摘要:The maximum product of sub-arrays in [1,n] can be divided by 3 cases:A[n] is the maximum product of all sub-arrays in [1, n].The array which has th... 阅读全文
posted @ 2014-11-21 16:29 kid551 阅读(300) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示