随笔分类 -  LeetCode

摘要:Rotate Image (M) 题目 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 i 阅读全文
posted @ 2020-07-01 02:05 墨云黑 阅读(138) 评论(0) 推荐(0)
摘要:Increasing Triplet Subsequence (M) 题目 Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formall 阅读全文
posted @ 2020-06-30 06:54 墨云黑 阅读(98) 评论(0) 推荐(0)
摘要:Intersection of Two Arrays II (E) 题目 Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2 阅读全文
posted @ 2020-06-30 04:10 墨云黑 阅读(101) 评论(0) 推荐(0)
摘要:Permutations II (M) 题目 Given a collection of numbers that might contain duplicates, return all possible unique permutations. Example: Input: [1,1,2] O 阅读全文
posted @ 2020-06-30 03:33 墨云黑 阅读(112) 评论(0) 推荐(0)
摘要:Permutations (M) 题目 Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2, 阅读全文
posted @ 2020-06-30 02:54 墨云黑 阅读(174) 评论(0) 推荐(0)
摘要:Jump Game II (H) 题目 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array r 阅读全文
posted @ 2020-06-30 01:45 墨云黑 阅读(146) 评论(0) 推荐(0)
摘要:Intersection of Two Arrays (E) 题目 Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] 阅读全文
posted @ 2020-06-29 07:08 墨云黑 阅读(127) 评论(0) 推荐(0)
摘要:Wildcard Matching (H) 题目 Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'. '?' Matches an 阅读全文
posted @ 2020-06-29 05:32 墨云黑 阅读(156) 评论(0) 推荐(0)
摘要:Multiply Strings (M) 题目 Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as 阅读全文
posted @ 2020-06-29 03:06 墨云黑 阅读(131) 评论(0) 推荐(0)
摘要:Trapping Rain Water (H) 题目 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is 阅读全文
posted @ 2020-06-29 02:34 墨云黑 阅读(184) 评论(0) 推荐(0)
摘要:Flatten Nested List Iterator (M) 题目 Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list 阅读全文
posted @ 2020-06-28 06:21 墨云黑 阅读(169) 评论(0) 推荐(0)
摘要:Integer Break (M) 题目 Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. R 阅读全文
posted @ 2020-06-28 03:25 墨云黑 阅读(140) 评论(0) 推荐(0)
摘要:Reverse Vowels of a String (E) 题目 Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Input: "hello" Out 阅读全文
posted @ 2020-06-28 02:07 墨云黑 阅读(117) 评论(0) 推荐(0)
摘要:Coin Change (M) 题目 You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of 阅读全文
posted @ 2020-06-27 09:29 墨云黑 阅读(177) 评论(0) 推荐(0)
摘要:Reverse String (E) 题目 Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space 阅读全文
posted @ 2020-06-27 07:02 墨云黑 阅读(119) 评论(0) 推荐(0)
摘要:Range Sum Query 2D - Immutable (M) 题目 Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (ro 阅读全文
posted @ 2020-06-27 06:53 墨云黑 阅读(154) 评论(0) 推荐(0)
摘要:Range Sum Query - Immutable (E) 题目 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Give 阅读全文
posted @ 2020-06-27 05:58 墨云黑 阅读(164) 评论(0) 推荐(0)
摘要:First Missing Positive (H) 题目 Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 阅读全文
posted @ 2020-06-27 05:34 墨云黑 阅读(139) 评论(0) 推荐(0)
摘要:Combination Sum II (M) 题目 Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidate 阅读全文
posted @ 2020-06-27 03:30 墨云黑 阅读(98) 评论(0) 推荐(0)
摘要:Combination Sum (M) 题目 Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations i 阅读全文
posted @ 2020-06-27 02:46 墨云黑 阅读(82) 评论(0) 推荐(0)