
leetcode
tommyzzz
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode_Rotate Image
题目要求: You are given annxn2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate the imagein-place, which means you have to modify the input 2D m...原创 2019-07-02 10:25:51 · 140 阅读 · 0 评论 -
leecode_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] ] E...原创 2019-07-05 15:17:36 · 118 阅读 · 0 评论 -
leetcode_96. Unique Binary Search Trees/leetcode_95. Unique Binary Search Trees II
先看96题 Givenn, how many structurally uniqueBST's(binary search trees) that store values 1 ...n? Example: Input: 3 Output: 5 Explanation: Given n = 3, there are a total of 5 unique BST's: 1 ...原创 2019-07-10 15:26:56 · 204 阅读 · 0 评论 -
leecode_63. Unique Paths II
这个问题类似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 t...原创 2019-07-05 10:35:11 · 126 阅读 · 0 评论 -
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 tryin...原创 2019-07-05 09:25:38 · 604 阅读 · 0 评论 -
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 = 2 Output: 4->5->1->2->3->NULL Explan...原创 2019-07-04 16:53:45 · 120 阅读 · 0 评论 -
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" "312"...原创 2019-07-04 15:47:47 · 154 阅读 · 0 评论 -
leetcode_91. Decode Ways
A message containing letters fromA-Zis being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given anon-emptystring containing only digits, determine t...原创 2019-07-09 16:31:27 · 143 阅读 · 0 评论 -
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 found ...原创 2019-07-08 17:06:43 · 152 阅读 · 0 评论 -
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 bymod...原创 2019-07-08 15:48:44 · 128 阅读 · 0 评论 -
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 yo...原创 2019-07-02 18:47:30 · 136 阅读 · 0 评论 -
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,5] ...原创 2019-07-02 17:42:41 · 112 阅读 · 0 评论 -
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], [1...原创 2019-07-08 10:52:35 · 134 阅读 · 0 评论 -
leetcode_77. Combinations
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n. Example: Input:n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] 一看就是一道时间复杂度...原创 2019-07-05 16:53:17 · 136 阅读 · 0 评论