随笔分类 -  LeetCode解题

上一页 1 2 3 4 5 6 下一页
63. 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 empty 阅读全文
posted @ 2018-03-09 20:33 宵夜在哪 阅读(99) 评论(0) 推荐(0)
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 阅读全文
posted @ 2018-03-08 14:58 宵夜在哪 阅读(96) 评论(0) 推荐(0)
61. Rotate List 解题记录
摘要:题目描述: Given a list, rotate the list to the right by k places, where k is non-negative. Example: 解题思路: 这题如果用递归的话可以只需要遍历一遍就可以得到从右数的节点。但是题目给的k会大于n,还是要得到遍 阅读全文
posted @ 2018-03-07 18:32 宵夜在哪 阅读(142) 评论(0) 推荐(0)
60. Permutation Sequence 解题记录
摘要:题目描述: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following s 阅读全文
posted @ 2018-03-06 16:15 宵夜在哪 阅读(98) 评论(0) 推荐(0)
59. Spiral Matrix II 解题记录
摘要:题目描述: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the 阅读全文
posted @ 2018-03-05 08:33 宵夜在哪 阅读(109) 评论(0) 推荐(0)
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 阅读全文
posted @ 2018-03-03 21:21 宵夜在哪 阅读(121) 评论(0) 推荐(0)
54. Spiral Matrix 解题记录
摘要:题目描述: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix 阅读全文
posted @ 2018-03-03 20:02 宵夜在哪 阅读(111) 评论(0) 推荐(0)
50. Pow(x, n) 解题记录
摘要:题目描述: Implement pow(x, n). Example 1: Example 2: 解题思路: pow(x,n)=pow(x,n/2)*pow(x,n/2) 代码: 阅读全文
posted @ 2018-03-02 16:21 宵夜在哪 阅读(112) 评论(0) 推荐(0)
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, 阅读全文
posted @ 2018-03-02 15:12 宵夜在哪 阅读(95) 评论(0) 推荐(0)
47. Permutations II 解题记录
摘要:题目描述: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following uni 阅读全文
posted @ 2018-03-01 23:28 宵夜在哪 阅读(92) 评论(0) 推荐(0)
46. Permutations 解题记录
摘要:题目描述: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 题目要我们找到数组(无重复元素)的 阅读全文
posted @ 2018-03-01 22:51 宵夜在哪 阅读(91) 评论(0) 推荐(0)
43. Multiply Strings 解题记录
摘要:题目描述: Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Note: 题目要我们计算两个数(string形式,非负,只含数字,长度小 阅读全文
posted @ 2018-03-01 22:17 宵夜在哪 阅读(85) 评论(0) 推荐(0)
40. Combination Sum II 解题记录
摘要:题目描述: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Ea 阅读全文
posted @ 2018-03-01 00:21 宵夜在哪 阅读(106) 评论(0) 推荐(0)
39. Combination Sum 解题记录
摘要:题目描述: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers 阅读全文
posted @ 2018-02-28 23:57 宵夜在哪 阅读(101) 评论(0) 推荐(0)
36. Valid Sudoku 解题记录
摘要:题目描述: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are fill 阅读全文
posted @ 2018-02-28 00:26 宵夜在哪 阅读(113) 评论(0) 推荐(0)
34. Search for a Range 解题思路
摘要:题目描述: Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime co 阅读全文
posted @ 2018-02-27 23:16 宵夜在哪 阅读(105) 评论(0) 推荐(0)
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). 阅读全文
posted @ 2018-02-27 00:53 宵夜在哪 阅读(92) 评论(0) 推荐(0)
31. Next Permutation 解题记录
摘要:题目描述: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not 阅读全文
posted @ 2018-02-27 00:37 宵夜在哪 阅读(103) 评论(0) 推荐(0)
24. 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->1->4->3. 阅读全文
posted @ 2018-02-26 00:17 宵夜在哪 阅读(90) 评论(0) 推荐(0)
19. Remove Nth Node From End of List 解题记录
摘要:题目描述: Given a linked list, remove the nth node from the end of list and return its head. For example, Note: Given n will always be valid. Try to do th 阅读全文
posted @ 2018-02-25 23:05 宵夜在哪 阅读(92) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 下一页