- 博客(23)
- 收藏
- 关注
原创 leetcode 15. 3Sum
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not contai...
2019-06-22 15:39:02 146
原创 leetcode 152. Maximum Product Subarray
Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.Example 1:Input: [2,3,-2,4]Output: 6Explanation: [2,3] has ...
2019-06-22 15:37:36 142
原创 leetcode 54. Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.Example 1:Input:[[ 1, 2, 3 ],[ 4, 5, 6 ],[ 7, 8, 9 ]]Output: [1,2,3,6,9,8,7,4,5]Example...
2019-06-22 15:34:49 204
原创 Leetcode 55. 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 maximum jump length at that position.Determine if you ...
2019-06-22 15:33:39 205
原创 leetcode 33.Search in Rotated Sorted Array
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a target value to search. If found in...
2019-06-18 11:13:11 142
原创 leetcode 34. Find First and Last Position of Element in Sorted Array
Given 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 order of O(log n).If the t...
2019-06-18 10:53:10 158
原创 Leetcode 56. Merge Intervals
Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10],[15,18]]Explanation: Since intervals [1,3] and [2,6] overlaps, m...
2019-06-18 10:45:00 121
原创 leetcode 162. Find Peak Element
A peak element is an element that is greater than its neighbors.Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return its index.The array may contain multiple peaks, i...
2019-06-15 17:07:50 128
原创 leetcode 73. Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place.Example 1:Input:[[1,1,1],[1,0,1],[1,1,1]]Output:[[1,0,1],[0,0,0],[1,0,1]]Example 2:Input:[...
2019-06-15 16:26:20 115
原创 leetcode 79. Word Search
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically ne...
2019-06-15 16:04:11 128
原创 leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.For example, givenpreorder = [3,9,20,15,7]inorder = [9,3,15,...
2019-06-12 11:35:21 100
原创 leetcode 75. Sort Colors
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the int...
2019-06-12 11:33:42 107
原创 leetcode 11. Container With Most Water
Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two l...
2019-06-12 11:32:46 149
原创 Leetcode 289. Game of Life
According to the Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.”Given a board with m by n ...
2019-06-10 14:57:27 113
原创 leetcode 62. 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 at any point in time. The robot is trying to reach the bot...
2019-06-09 17:13:27 123
原创 leetcode 48. Rotate Image
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to modify the input 2D matrix dire...
2019-06-09 17:09:43 109
原创 Leetcode 287. Find the Duplicate Number
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, fi...
2019-06-09 16:58:26 211
原创 记 Leetcode.Weekly Contest 140
Ranking :966/40475083. Occurrences After BigramGiven words first and second, consider occurrences in some text of the form “first second third”, where second comes immediately after first, and third...
2019-06-09 15:34:15 157
原创 Leetcode 78. Subsets
Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.Example:Input: nums = [1,2,3]Output:[[3],[1],[2],...
2019-06-04 21:01:29 149
原创 leetcode 238. Product of Array Except Self
Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Example:Input: [1,2,3,4]Output: [24...
2019-06-04 20:24:56 127
原创 Leetcode 189. Rotate Array
Given an array, rotate the array to the right by k steps, where k is non-negative.Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the right: [7,1,2,...
2019-06-03 17:22:57 129
转载 Python可视化中Matplotlib(3.线条的详细样式及线性、保存图片、plot的详细风格和样式)、背景色、点和线的详细设置
转自https://blog.csdn.net/wei18791957243/article/details/838312661.修改线条的样式: linestyle、color、marker(标记)''' 颜色 color:修改颜色,可以简写成c 样式 linestyle='--' 修改线条的样式 可以简写成 ls 标注 marker : 标注 线宽 ...
2019-06-03 14:55:37 3137
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人