![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 78
fibo_nacci
C/C coder
展开
-
**Leetcode_largest-rectangle-in-histogram(c++ and python version)
地址:http://oj.leetcode.com/problems/largest-rectangle-in-histogram/原创 2014-05-04 11:25:21 · 845 阅读 · 0 评论 -
*Leetcode_binary-tree-maximum-path-sum (updated c++ and python version)
地址:http://oj.leetcode.com/problems/binary-tree-maximum-path-sum/Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be原创 2014-05-14 12:53:33 · 659 阅读 · 0 评论 -
Leetcode_path-sum (updated c++ and python version)
地址:http://oj.leetcode.com/problems/path-sum/Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo原创 2014-03-23 13:22:32 · 508 阅读 · 0 评论 -
Leetcode_binary-tree-zigzag-level-order-traversal (updated c++ and python version)
地址:http://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right原创 2014-03-18 23:43:45 · 724 阅读 · 0 评论 -
**Leetcode_copy-list-with-random-pointer (c++ and python version)
地址:http://oj.leetcode.com/problems/copy-list-with-random-pointer/A linked list is given such that each node contains an additional random pointer which could point to any node in the list or nul原创 2014-03-22 22:18:38 · 837 阅读 · 0 评论 -
Leetcode_next-permutation(c++ and python version)
地址:http://oj.leetcode.com/problems/next-permutation/原创 2014-05-09 23:58:16 · 583 阅读 · 0 评论 -
Leetcode_swap-nodes-in-pairs(c++ and python version)
地址:http://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2-原创 2014-03-17 19:28:30 · 544 阅读 · 0 评论 -
Leetcode_remove-duplicates-from-sorted-array-ii (c++ and python version)
地址:http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted arra原创 2014-03-23 13:33:07 · 694 阅读 · 0 评论 -
Leetcode_best-time-to-buy-and-sell-stock(c++ and python version)
地址:http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to comple原创 2014-03-31 21:18:23 · 508 阅读 · 0 评论 -
Leetcode_plus-one(c++ and python updated)
地址:http://oj.leetcode.com/problems/plus-one/Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant d原创 2014-03-21 22:55:29 · 530 阅读 · 0 评论 -
Leetcode_climbing-statirs (c++ and python version)
地址:http://oj.leetcode.com/problems/climbing-stairs/You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct w原创 2014-03-21 19:24:34 · 548 阅读 · 0 评论 -
Leetcode_sort-colors(c++ and python updated)
地址:http://oj.leetcode.com/problems/sort-colors/Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order re原创 2014-04-02 22:45:27 · 500 阅读 · 0 评论 -
Leetcode_binary-tree-level-order-traversal (updated c++ and python version)
地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal/Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For原创 2014-03-18 23:01:30 · 618 阅读 · 0 评论 -
Leetcode_maximum-depth-of-binary-tree (updated c++ and python version)
地址:http://oj.leetcode.com/problems/maximum-depth-of-binary-tree/Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node原创 2014-03-18 10:08:22 · 618 阅读 · 0 评论 -
**Leetcode_median-of-two-sorted-arrays (c++ and python version)
地址:http://oj.leetcode.com/problems/median-of-two-sorted-arrays/There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time comp原创 2014-05-08 20:35:56 · 869 阅读 · 0 评论 -
Leetcode_count-and-say(c++ and python version)
地址:http://oj.leetcode.com/problems/count-and-say/The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.原创 2014-04-14 16:42:42 · 638 阅读 · 0 评论 -
Leetcode_word-break(c++ and python version)
地址:http://oj.leetcode.com/problems/word-break/原创 2014-04-05 22:27:37 · 934 阅读 · 0 评论 -
Leetcode_two-sum (c++ and python version)
地址:http://oj.leetcode.com/problems/two-sum/Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two原创 2014-03-27 01:17:16 · 710 阅读 · 0 评论 -
Leetcode_remove-duplicates-from-sorted-list (updated c++ and python version)
地址:http://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/ Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1-原创 2014-03-20 22:23:16 · 630 阅读 · 0 评论 -
Leetcode_search-in-rotated-sorted-array-ii(updated c++ and python version)
地址:http://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity原创 2014-05-10 11:10:03 · 777 阅读 · 0 评论 -
Leetcode_unique-paths (updated c++ and python version)
地址:http://oj.leetcode.com/problems/unique-paths/A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right a原创 2014-03-23 00:55:24 · 558 阅读 · 0 评论 -
Leetcode_unique-paths-ii
地址:http://oj.leetcode.com/problems/unique-paths-ii/Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and原创 2014-03-26 17:27:18 · 536 阅读 · 0 评论 -
Leetcode_pascals-triangle (updated c++ and python version)
地址:http://oj.leetcode.com/problems/pascals-triangle/Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2原创 2014-03-22 09:50:55 · 429 阅读 · 0 评论 -
Leetcode_multiply-strings (updated c++ and python version)
地址:http://oj.leetcode.com/problems/multiply-strings/Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and原创 2014-05-05 14:59:14 · 610 阅读 · 0 评论 -
Leetcode_first-missing-positive (updated c++ and python version)
地址:http://oj.leetcode.com/problems/first-missing-positive/思路:模拟题。用一个足够长的布尔数组来存储。时间复杂度O(N), 空间复杂度都O(k).参考代码:class Solution {public: bool bs[1000000]; int firstMissingPositive(int A[]原创 2014-03-26 14:05:06 · 558 阅读 · 0 评论 -
Leetcode_minimum-depth-of-binary-tree (c++ and python version)
地址:http://oj.leetcode.com/problems/minimum-depth-of-binary-tree/Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root nod原创 2014-03-19 11:56:29 · 590 阅读 · 0 评论 -
Leetcode_search-for-a-range
http://oj.leetcode.com/problems/search-for-a-range/Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in原创 2014-03-25 15:47:04 · 534 阅读 · 0 评论 -
Leetcode_valid-number(updated c++ and python version)
地址:http://oj.leetcode.com/problems/valid-number/原创 2014-05-01 20:55:06 · 581 阅读 · 0 评论 -
Leetcode_jump-game-ii(c++ and python version)
地址:http://oj.leetcode.com/problems/jump-game-ii/Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents you原创 2014-05-05 13:51:43 · 680 阅读 · 0 评论 -
Leetcode_jump-game (updated c++ and python version)
地址:http://oj.leetcode.com/problems/jump-game/Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your m原创 2014-03-26 16:07:41 · 563 阅读 · 0 评论 -
Leetcode_trapping-rain-water(updated c++ and python version)
地址:http://oj.leetcode.com/problems/trapping-rain-water/Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap aft原创 2014-05-04 14:15:15 · 586 阅读 · 0 评论 -
Leetcode_remove-duplicates-from-sorted-array
地址:http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.原创 2014-03-17 20:16:28 · 447 阅读 · 0 评论 -
Leetcode_pascals-triangle-ii (updated c++ and python version)
地址:http://oj.leetcode.com/problems/pascals-triangle-ii/Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your原创 2014-03-24 16:21:16 · 595 阅读 · 0 评论 -
python 学习
最近看到一个网站 Visit it! ,介绍锻炼思维的14种方式,其中interactive platform处有个链接Ten ways to learn python, 我正好想系统学习下python, 比如其中的Google python class就是很出名的. 其中感觉第三个链接Visit it, 今天大半天基本都在做这个了, 很不错的样子.原创 2014-04-28 22:51:20 · 474 阅读 · 0 评论 -
Leetcode_wildcard-matching(c++ and python version)
地址:http://oj.leetcode.com/problems/wildcard-matching/原创 2014-04-10 22:17:37 · 748 阅读 · 4 评论 -
Leetcode_permutation-sequence(c++ and python version)
地址:http://oj.leetcode.com/problems/permutation-sequence/原创 2014-05-08 23:31:32 · 623 阅读 · 0 评论 -
Leetcode_best-time-to-buy-and-sell-stock-ii(c++ and python version)
地址: http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the原创 2014-03-31 21:58:20 · 680 阅读 · 0 评论 -
Leetcode_powx-n(c++ and python version)
地址:http://oj.leetcode.com/problems/powx-n/Implement pow(x, n).s原创 2014-04-25 11:22:18 · 613 阅读 · 0 评论 -
Leetcode_populating-next-right-pointers-in-each-node-ii(updated c++ version)
地址:http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/原创 2014-05-05 10:05:49 · 808 阅读 · 0 评论 -
Leetcode_populating-next-right-pointers-in-each-node(updated c++ and python version)
地址:http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkN原创 2014-03-31 12:51:43 · 601 阅读 · 0 评论