自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

希望的专栏

有梦的地方就有希望

  • 博客(832)
  • 论坛 (1)

原创 开篇

今天刚开博客,希望自己能每天坚持编程,嘿嘿,现在刚接触C语言不久,虽然自己很菜,但是我会一直努力,迟早有一天,我会打下属于自己的一片天地!最简单的一个小程序:#includemain(){printf("Hollow everyone,I will struggle for myself forever!");}这是开篇,以后还会继续...坚持下去!!j

2015-03-23 21:55:01 548 1

原创 【LeetCode】92. Reverse Linked List II

题目:Reverse a linked list from positionmton. Do it in one-pass.Note:1 ≤m≤n≤ length of list.Example:Input: 1->2->3->4->5->NULL, m = 2, n = 4Output: 1->4->3->2-&...

2019-07-28 17:50:58 47

原创 【LeetCode】91. Decode Ways

题目:A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given anon-emptystring containing only digits, determ...

2019-07-24 22:31:03 40

原创 【LeetCode】90. Subsets II

题目:Given a collection of integers that might contain duplicates,nums, return all possible subsets (the power set).Note:The solution set must not contain duplicate subsets.Example:Input: [1,...

2019-07-15 21:35:54 50

原创 【LeetCode】89. Gray Code【未完待续】

题目:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number of bits in the code, print the sequence ...

2019-07-12 23:03:05 50

原创 【LeetCode】88. Merge Sorted Array

题目:Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:The number of elements initialized innums1andnums2aremandnrespectively. You may assume...

2019-07-01 21:44:16 94

原创 【LeetCode】87. Scramble String

题目:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation ofs1="great": great / \ ...

2019-06-24 21:58:58 37

原创 【LeetCode】86. Partition List

题目:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the original relative order of the nodes in each...

2019-06-12 22:49:54 41

原创 【LeetCode】85. Maximal Rectangle【未完待续】

题目:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.Example:Input:[ ["1","0","1","0","0"], ["1","0","1","1","1"], ["1"...

2019-06-11 22:29:06 23

原创 【LeetCode】84. Largest Rectangle in Histogram

题目:Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width ...

2019-06-04 22:33:24 30

原创 【LeetCode】83. Remove Duplicates from Sorted List

题目:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1->2->3->3Outpu...

2019-05-31 22:56:58 34

原创 【LeetCode】82. Remove Duplicates from Sorted List II

题目:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.Example 1:Input: 1->2->3->3->4->4->5Output: ...

2019-05-31 22:50:43 29

原创 【LeetCode】81. Search in Rotated Sorted Array II

题目:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e.,[0,0,1,2,2,5,6]might become[2,5,6,0,0,1,2]).You are given a target value to search. If f...

2019-05-29 22:56:23 18

原创 【LeetCode】80. Remove Duplicates from Sorted Array II

题目:Given a sorted arraynums, remove the duplicatesin-placesuch that duplicates appeared at mosttwiceand return the new length.Do not allocate extra space for another array, you must do this b...

2019-05-28 21:17:32 34

原创 【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 vertica...

2019-05-27 22:42:54 27

原创 【LeetCode】78. Subsets

题目:Given a set ofdistinctintegers,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],...

2019-05-26 21:04:48 31

原创 【LeetCode】77. Combinations

题目:Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.Example:Input:n = 4, k = 2Output:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]描述:给...

2019-05-24 22:57:31 31

原创 【LeetCode】76. Minimum Window Substring

题目:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).Example:Input: S = "ADOBECODEBANC", T = "ABC"Output: "BANC"Not...

2019-05-24 20:43:58 29

原创 【LeetCode】75. Sort Colors

题目:Given an array withnobjects colored red, white or blue, sort themin-placeso that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use t...

2019-05-19 09:46:41 23

原创 【LeetCode】74. Search a 2D Matrix

题目:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from left to right. The first integer of eac...

2019-05-17 08:59:35 28

原创 【LeetCode】73. Set Matrix Zeroes【未完待续】

题目:Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do itin-place.Example 1:Input: [ [1,1,1], [1,0,1], [1,1,1]]Output: [ [1,0,1], [0,0,0], [1,0,1]...

2019-05-16 21:56:44 33

原创 【LeetCode】72. Edit Distance

题目:Given two wordsword1andword2, find the minimum number of operations required to convertword1toword2.You have the following 3 operations permitted on a word:Insert a character Delete a ...

2019-05-15 08:57:35 20

原创 【LeetCode】71. Simplify Path

题目:Given anabsolute pathfor a file (Unix-style), simplify it. Or in other words, convert it to thecanonical path.In a UNIX-style file system, a period.refers to the current directory. Further...

2019-05-12 22:21:28 33

原创 【LeetCode】70. Climbing Stairs

题目:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note:Givennwill be a pos...

2019-05-11 15:39:58 31

原创 【LeetCode】69. Sqrt(x)

题目:Implementint sqrt(int x).Compute and return the square root ofx, wherexis guaranteed to be a non-negative integer.Since the return typeis an integer, the decimal digits are truncated and...

2019-05-11 14:56:00 32

原创 【LeetCode】68. Text Justification

题目:Given an array of words and a widthmaxWidth, format the text such that each line has exactlymaxWidthcharacters and is fully (left and right) justified.You should pack your words in a greedy a...

2019-05-11 11:06:54 38

原创 【LeetCode】67. Add Binary

题目:Given two binary strings, return their sum (also a binary string).The input strings are bothnon-emptyand contains only characters1or0.Example 1:Input: a = "11", b = "1"Output: "100"...

2019-05-10 22:22:52 38

原创 【LeetCode】66. Plus One

题目:Given anon-emptyarray of digitsrepresenting a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list, and each el...

2019-05-10 22:03:43 29

原创 【LeetCode】65. Valid Number

题目:Validate if a given string can be interpreted asa decimal number.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>true" -90e3 "=>true" 1e"=&...

2019-05-10 21:40:10 28

原创 【LeetCode】64. Minimum Path Sum

题目:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:You can only move either down or right...

2019-05-09 08:44:00 27

原创 【LeetCode】63. Unique Paths II

题目:A robot is located at the top-left corner of amxngrid (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 t...

2019-05-08 22:17:19 39

原创 【LeetCode】62. Unique Paths

题目:A robot is located at the top-left corner of amxngrid (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 t...

2019-05-06 23:14:57 32

原创 【LeetCode】61. Rotate List

题目:Given a linkedlist, rotate the list to the right bykplaces, wherekis non-negative.Example 1:Input: 1->2->3->4->5->NULL, k = 2Output: 4->5->1->2->3->NULLE...

2019-05-06 20:46:48 41

原创 【LeetCode】60. Permutation Sequence

题目:The set[1,2,3,...,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order, we get the following sequence forn= 3:"123" "132" "213" "231" ...

2019-05-06 08:49:57 26

原创 【LeetCode】59. Spiral Matrix II

题目:Given a positive integern, generate a square matrix filled with elements from 1 ton2in spiral order.Example:Input: 3Output:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ]]描述:给出一个n表示要...

2019-05-06 08:30:21 31

原创 【LeetCode】58. Length of Last Word

题目:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word does not exist, return 0.Note:A word is ...

2019-05-05 21:09:12 32

原创 【LeetCode】57. Insert Interval

题目:Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times....

2019-05-04 23:08:58 36

原创 【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] ove...

2019-05-04 20:37:34 43

原创 【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 ...

2019-05-04 12:15:42 35

原创 【LeetCode】54. Spiral Matrix

题目:Given a matrix ofmxnelements (mrows,ncolumns), 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...

2019-05-04 09:42:13 48

空空如也

求解答.....

发表于 2016-01-17 最后回复 2016-01-17

空空如也
提示
确定要删除当前文章?
取消 删除