[LeetCode] First Missing Positive 解题报告

摘要: Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm sho... 阅读全文
posted @ 2012-12-21 16:40 小刀初试 阅读(129) 评论(0) 推荐(0)

[LeetCode] Edit Distance 解题报告

摘要: 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... 阅读全文
posted @ 2012-12-21 14:35 小刀初试 阅读(147) 评论(0) 推荐(0)

[LeetCode] Divide Two Integers 解题报告

摘要: Divide two integers without using multiplication, division and mod operator.两个数的除法,但是不允许用乘、除、取余符号。[解题思路]如果可以用乘的话,二分搜索倒是不错的解法。否则,只能寄希望于位符操作了。 基本思想就是把除数... 阅读全文
posted @ 2012-12-21 04:49 小刀初试 阅读(185) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示