leetcode
孤舟钓客
人生如梦,梦何曾醒?不过旧愁新怨。但无他。回首向来萧瑟处,也无风雨也无晴。夜阑风静彀纹平,小舟从此逝,江海寄馀生。
展开
-
leetcode practice - python3 (1)
1. Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not u...原创 2018-05-13 14:18:18 · 265 阅读 · 0 评论 -
leetcode practice - python3 (15)
34. Search for a RangeGiven an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the or...原创 2018-06-23 20:28:49 · 279 阅读 · 0 评论 -
leetcode practice - python3 (10)
198. House RobberDescriptionHintsSubmissionsDiscussSolution You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain...原创 2018-05-28 23:36:46 · 293 阅读 · 0 评论 -
leetcode practice - python3 (13)
560. Subarray Sum Equals KDescriptionHintsSubmissionsDiscussSolution Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k.E...原创 2018-06-04 19:45:23 · 243 阅读 · 0 评论 -
leetcode practice - python3 (12)
236. Lowest Common Ancestor of a Binary TreeDescriptionHintsSubmissionsDiscussSolution Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the d...原创 2018-06-03 14:42:32 · 265 阅读 · 0 评论 -
leetcode practice - python3 (11)
198. House RobberDescriptionHintsSubmissionsDiscussSolution You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain...原创 2018-06-03 14:08:56 · 241 阅读 · 0 评论 -
leetcode practice - python3 (5)
98. Validate Binary Search TreeDescriptionHintsSubmissionsDiscussSolution Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left su...原创 2018-05-26 14:15:20 · 312 阅读 · 0 评论 -
leetcode practice - python3 (4)
78. SubsetsDescriptionHintsSubmissionsDiscussSolution Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets...原创 2018-05-20 20:01:40 · 213 阅读 · 0 评论 -
leetcode practice - python3 (3)
53. Maximum SubarrayDescriptionHintsSubmissionsDiscussSolution Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its su...原创 2018-05-16 19:34:49 · 168 阅读 · 0 评论 -
leetcode practice - python3 (2)
21. Merge Two Sorted ListsDescriptionHintsSubmissionsDiscussSolution Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir...原创 2018-05-15 19:05:43 · 198 阅读 · 0 评论 -
leetcode practice - python3 (9)
617. Merge Two Binary TreesDescriptionHintsSubmissionsDiscussSolution Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped...原创 2018-05-26 15:31:19 · 225 阅读 · 0 评论 -
leetcode practice - python3 (8)
169. Majority ElementDescriptionHintsSubmissionsDiscussSolution Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You m...原创 2018-05-26 15:14:26 · 385 阅读 · 0 评论 -
leetcode practice - python3 (7)
543. Diameter of Binary TreeDescriptionHintsSubmissionsDiscussSolution Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length o...原创 2018-05-26 14:57:55 · 277 阅读 · 0 评论 -
leetcode practice - python3 (6)
56. Merge IntervalsDescriptionHintsSubmissionsDiscussSolution Given a collection of intervals, merge all overlapping intervals.Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,1...原创 2018-05-26 14:33:59 · 234 阅读 · 0 评论 -
leetcode practice - python3 (14)
621. Task SchedulerDescriptionHintsSubmissionsDiscussSolution Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different ta...原创 2018-06-10 19:53:48 · 243 阅读 · 0 评论