上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 题目链接 "https://leetcode.com/problems/search a 2d matrix/" 题目原文 Write an efficient algorithm that searches for a value in an m x n matrix. This mat... 阅读全文
posted @ 2016-01-15 10:46 slurm 阅读(253) 评论(0) 推荐(0)
摘要: 题目链接 "https://leetcode.com/problems/set matrix zeroes/" 题目原文 Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it ... 阅读全文
posted @ 2016-01-14 17:22 slurm 阅读(201) 评论(0) 推荐(0)
摘要: 题目链接 "https://leetcode.com/problems/edit distance/" 题目原文 Given two words word1 and word2, find the minimum number of steps required to convert wo... 阅读全文
posted @ 2016-01-14 17:04 slurm 阅读(234) 评论(0) 推荐(0)
摘要: 题目链接 "https://leetcode.com/problems/simplify path/" 题目原文 Given an absolute path for a file (Unix style), simplify it. For example, path = , = p... 阅读全文
posted @ 2016-01-14 16:10 slurm 阅读(187) 评论(0) 推荐(0)
摘要: 题目链接 "https://leetcode.com/problems/climbing stairs/" 题目原文 You are climbing a stair case. It takes n steps to reach to the top. Each time you can... 阅读全文
posted @ 2016-01-13 10:34 slurm 阅读(197) 评论(0) 推荐(0)
摘要: 题目链接 "https://leetcode.com/problems/sqrtx/" 题目原文 Implement . Compute and return the square root of x. 题目大意 实现一个整型的开平方根 解题思路 使用牛顿迭代法进行求解 牛顿迭代... 阅读全文
posted @ 2016-01-13 10:20 slurm 阅读(449) 评论(0) 推荐(0)
摘要: 题目链接 "https://leetcode.com/problems/text justification/" 题目原文 Given an array of words and a length L, format the text such that each line has exa... 阅读全文
posted @ 2016-01-12 17:10 slurm 阅读(486) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode.com/problems/add-binary/题目大意:给定两个二进制字符串,返回它们的和解题思路:模拟二进制竖式加法class Solution(object): def addBinary(self, a, b): """ ... 阅读全文
posted @ 2016-01-12 16:08 slurm 阅读(245) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode.com/problems/plus-one/题目大意:用一个digit数组表示一个非负整数,加1后返回这个数组 例如:[9,9]加1返回[1,0,0]解题思路:从后往前遍历,一次判断进位即可;注意计算到最高位的时候是否有进位的处理class Solu... 阅读全文
posted @ 2016-01-12 15:50 slurm 阅读(273) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode.com/problems/valid-number/题目大意:给定一个字符串,判断是否是数字 如:"0"=>true " 0.1 "=>true "abc"=>false "1 a"=>false "2e10"=... 阅读全文
posted @ 2016-01-07 16:47 slurm 阅读(616) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 下一页