python_lintcode
xiongxu3381
不忘初心,玩转python,别忙着爬,楼下也要都观望~~
展开
-
python_lintcode_362. 滑动窗口的最大值
362. 滑动窗口的最大值题目给出一个可能包含重复的整数数组,和一个大小为 k 的滑动窗口, 从左到右在数组中滑动这个窗口,找到数组中每个窗口内的最大值。样例 给出数组 [1,2,7,7,8], 滑动窗口大小为 k = 3. 返回 [7,7,8].解释:最开始,窗口的状态如下:[|1, 2 ,7| ,7 , 8], 最大值为 7;然后窗口向右移动一位:[1...原创 2018-02-22 19:41:29 · 1578 阅读 · 0 评论 -
python_lintcode_372在O(1)时间复杂度删除链表节点_174删除链表中倒数第n个节点
python_lintcode_372在O(1)时间复杂度删除链表节点_174删除链表中倒数第n个节点原创 2017-10-09 19:59:09 · 818 阅读 · 0 评论 -
python_lintcode_115不同的路径 II_112删除排序链表中的重复元素
python_lintcode_115不同的路径 II_112删除排序链表中的重复元素原创 2017-10-08 21:07:11 · 1002 阅读 · 0 评论 -
python_lintcode_97二叉树的最大深度 _155二叉树的最小深度
python_lintcode_97二叉树的最大深度 _155二叉树的最小深度原创 2017-09-29 21:31:37 · 2176 阅读 · 0 评论 -
python_lintcode_52翻转字符串_128哈希函数
python_lintcode_52翻转字符串_128哈希函数原创 2017-09-21 15:57:03 · 587 阅读 · 0 评论 -
python_lintcode_697Check Sum of Square Numbers_114不同的路径
python_lintcode_697Check Sum of Square Numbers_114不同的路径原创 2017-10-07 18:59:12 · 269 阅读 · 0 评论 -
python_lintcode_167链表求和
167链表求和题目你有两个用链表代表的整数,其中每个节点包含一个数字。数字存储按照在原来整数中相反的顺序,使得第一个数字位于链表的开头。写出一个函数将两个整数相加,用链表形式返回和。样例 给出两个链表 3->1->5->null 和 5->9->2->null,返回 8->0->8->null原创 2017-09-13 08:55:17 · 1344 阅读 · 0 评论 -
python_lintcode_109数字三角形_50数组剔除元素后的乘积
python_lintcode_109数字三角形_50数组剔除元素后的乘积原创 2017-09-20 18:45:35 · 353 阅读 · 0 评论 -
python_lintcode_480二叉树的所有路径_376二叉树的路径和
python_lintcode_480二叉树的所有路径_376二叉树的路径和原创 2017-09-28 19:21:04 · 535 阅读 · 1 评论 -
python_lintcode_111爬楼梯_110最小路径和
python_lintcode_111爬楼梯_110最小路径和原创 2017-09-19 20:15:48 · 985 阅读 · 0 评论 -
python_lintcode_100删除排序数组中的重复数字 _101删除排序数组中的重复数字2
python_lintcode_100删除排序数组中的重复数字 _101删除排序数组中的重复数字2原创 2017-09-18 15:51:36 · 813 阅读 · 0 评论 -
python_lintcode_166链表倒数第n个节点_671循环单词
python_lintcode_166链表倒数第n个节点_671循环单词原创 2017-09-26 12:35:12 · 388 阅读 · 0 评论 -
python_lintcode_64合并排序数组 II_60搜索插入位置_142 O(1)时间检测2的幂次
python_lintcode_64合并排序数组 II_60搜索插入位置_142 O(1)时间检测2的幂次原创 2017-09-25 17:11:27 · 377 阅读 · 0 评论 -
python_lintcode_700Cutting a Rod_418整数转罗马数字
python_lintcode_700Cutting a Rod_418整数转罗马数字原创 2017-10-10 10:43:52 · 302 阅读 · 0 评论 -
python_lintcode_69二叉树的层次遍历
python_lintcode_69二叉树的层次遍历原创 2017-10-02 22:19:36 · 959 阅读 · 0 评论 -
python_lintcode_96. 链表划分_389. 判断数独是否合法
96. 链表划分题目给定一个单链表和数值x,划分链表使得所有小于x的节点排在大于等于x的节点之前。你应该保留两部分内链表节点原有的相对顺序。样例给定链表 1->4->3->2->5->2->null,并且 x=3返回 1->2->2->4->3->5->null思路简单思路:就是新建两条链表分别存储小于x的和大于x的,然后在将两条链表进行合并即可。原创 2018-01-07 15:24:52 · 436 阅读 · 0 评论 -
python_lintcode_737. Find Elements in Matrix_451. 两两交换链表中的节点
python_lintcode_737. Find Elements in Matrix_451. 两两交换链表中的节点原创 2017-12-28 21:26:41 · 228 阅读 · 0 评论 -
python_lintcode_680. 分割字符串
python_lintcode_680. 分割字符串原创 2018-01-04 14:10:48 · 578 阅读 · 0 评论 -
python_lintcode_730. 所有子集的和_720. Rearrange a String With Integers
python_lintcode_730. 所有子集的和_720. Rearrange a String With Integers原创 2017-12-27 23:36:48 · 270 阅读 · 0 评论 -
python_lintcode_698数组中最大的差值_3. 统计数字_12. 带最小值操作的栈
python_lintcode_698数组中最大的差值_3. 统计数字_12. 带最小值操作的栈原创 2018-01-03 14:26:03 · 869 阅读 · 0 评论 -
python_lintcode_730. 所有子集的和_720. Rearrange a String With Integers
730. 所有子集的和题目给一整数 n, 我们需要求前n个自然数形成的集合的所有可能子集中所有元素的和。样例 给出 n = 2, 返回 6 可能的子集为 {{1}, {2}, {1, 2}}. 子集的元素和为 1 + 2 + 1 + 2 = 6给出 n = 3, 返回 24 可能的子集为 {{1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3},原创 2018-01-11 23:27:12 · 450 阅读 · 0 评论 -
python_lintcode_177. 把排序数组转换为高度最小的二叉搜索树_156. 合并区间
python_lintcode_177. 把排序数组转换为高度最小的二叉搜索树_156. 合并区间原创 2018-01-02 21:13:01 · 379 阅读 · 0 评论 -
python_lintcode_93. 平衡二叉树_165. 合并两个排序链表_453. 将二叉树拆成链表
python_lintcode_93. 平衡二叉树_165. 合并两个排序链表_453. 将二叉树拆成链表原创 2017-12-26 18:34:28 · 337 阅读 · 0 评论 -
python_lintcode_149买卖股票的最佳时机_150买卖股票的最佳时机II_151买卖股票的最佳时机III
python_lintcode_149买卖股票的最佳时机_150买卖股票的最佳时机II_151买卖股票的最佳时机III原创 2017-10-16 15:50:21 · 441 阅读 · 0 评论 -
python_lintcode_702Concatenated String with Uncommon Characters of Two Strings
python_lintcode_702Concatenated String with Uncommon Characters of Two Strings原创 2017-10-15 07:56:17 · 456 阅读 · 0 评论 -
python_lintcode_718重复字串_706二进制时间
python_lintcode_718重复字串_706二进制时间原创 2017-10-17 23:42:57 · 393 阅读 · 0 评论 -
python_lintcode_419罗马数字转整数_688The Number In Words
python_lintcode_419罗马数字转整数_688The Number In Words原创 2017-10-11 23:19:54 · 494 阅读 · 0 评论 -
python_lintcode_82落单的数_83落单的数 II_84落单的数 III
python_lintcode_82落单的数_83落单的数 II_84落单的数 III原创 2017-09-25 16:39:49 · 621 阅读 · 0 评论 -
python_lintcode_397最长上升连续子序列_56两数之和
python_lintcode_397最长上升连续子序列_56两数之和原创 2017-09-16 16:27:33 · 648 阅读 · 0 评论 -
python_lintcode_困难题_54
54 转换字符串到整数题目:实现atoi这个函数,将一个字符串转换为整数。如果没有合法的整数,返回0。如果整数超出了32位整数的范围,返回INT_MAX(2147483647)如果是正整数,或者INT_MIN(-2147483648)如果是负整数。原创 2017-08-07 21:20:10 · 262 阅读 · 0 评论 -
lintcode python 代码 514 栅栏染色
我们有一个栅栏,它有n个柱子,现在要给柱子染色,有k种颜色可以染。 必须保证任意两个相邻的柱子颜色不同,求有多少种染色方案。转载 2017-07-31 10:35:32 · 306 阅读 · 0 评论 -
LintCode python 小白-简单题-2 尾部的0
题目:设计一个算法,计算出n阶乘中尾部零的个数样例 11! = 39916800,因此应该返回 2原创 2017-07-30 16:12:25 · 271 阅读 · 0 评论 -
LintCode python 小白-简单题-548两数组的交Ⅱ
题目:计算两个数组的交注意事项 每个元素出现次数得和在数组里一样 答案可以以任意顺序给出样例:nums1 = [1, 2, 2, 1], nums2 = [2, 2], 返回 [2, 2].原创 2017-07-30 15:00:23 · 311 阅读 · 0 评论 -
LintCoder python 小白2-骰子求和
骰子求和原创 2017-07-08 22:42:15 · 1379 阅读 · 0 评论 -
LintCode python 小白-简单题-22平面列表
题目:给定一个列表,该列表中的每个要素要么是个列表,要么是整数。将其变成一个只包含整数的简单列表。注意事项:如果给定的列表中的要素本身也是一个列表,那么它也可以包含列表。原创 2017-07-29 18:00:45 · 914 阅读 · 0 评论 -
LintCode python 小白7-超级丑数
题目:写一个程序来找第 n 个超级丑数。 超级丑数的定义是正整数并且所有的质数因子都在所给定的一个大小为 k 的质数集合内。原创 2017-07-15 11:09:16 · 448 阅读 · 0 评论 -
LintCode python 小白-硬币-博弈论,动态规划
题目:有 n 个不同价值的硬币排成一条线。两个参赛者轮流从左边依次拿走 1 或 2 个硬币,直到没有硬币为止。计算两个人分别拿到的硬币总价值,价值高的人获胜。原创 2017-07-10 20:35:41 · 2064 阅读 · 0 评论 -
LintCode python 小白6-丑数 II
题目:设计一个算法,找出只含素因子2,3,5 的第 n 大的数。符合条件的数如:1, 2, 3, 4, 5, 6, 8, 9, 10, 12…原创 2017-07-14 23:45:29 · 529 阅读 · 0 评论 -
LintCode python 小白5-丑数
丑数1原创 2017-07-13 11:16:23 · 224 阅读 · 0 评论 -
LintCode python 小白4-Big Integer Addition
Big Integer Addition原创 2017-07-12 23:01:24 · 328 阅读 · 0 评论