06 2020 档案

摘要: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 墨云黑 阅读(99) 评论(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 墨云黑 阅读(113) 评论(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 墨云黑 阅读(170) 评论(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 墨云黑 阅读(99) 评论(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)
摘要:Count and Say (E) 题目 The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 阅读全文
posted @ 2020-06-27 02:16 墨云黑 阅读(80) 评论(0) 推荐(0)
摘要:Rectangle Area (M) 题目 Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and 阅读全文
posted @ 2020-06-26 07:05 墨云黑 阅读(138) 评论(0) 推荐(0)
摘要:Game of Life (M) 题目 According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British 阅读全文
posted @ 2020-06-26 06:14 墨云黑 阅读(229) 评论(0) 推荐(0)
摘要:Sudoku Solver (H) 题目 Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: E 阅读全文
posted @ 2020-06-26 03:48 墨云黑 阅读(204) 评论(0) 推荐(0)
摘要:Valid Sudoku (M) 题目 Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row mu 阅读全文
posted @ 2020-06-26 02:33 墨云黑 阅读(128) 评论(0) 推荐(0)
摘要:Search Insert Position (E) 题目 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it woul 阅读全文
posted @ 2020-06-26 01:56 墨云黑 阅读(72) 评论(0) 推荐(0)
摘要:Find First and Last Position of Element in Sorted Array (M) 题目 Given an array of integers nums sorted in ascending order, find the starting and ending 阅读全文
posted @ 2020-06-26 01:49 墨云黑 阅读(62) 评论(0) 推荐(0)
摘要:Find the Duplicate Number (M) 题目 Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least 阅读全文
posted @ 2020-06-25 08:31 墨云黑 阅读(131) 评论(0) 推荐(0)
摘要:题目 Given an array of citations sorted in ascending order (each citation is a non-negative integer) of a researcher, write a function to compute the re 阅读全文
posted @ 2020-06-25 06:12 墨云黑 阅读(144) 评论(0) 推荐(0)
摘要:Search in Rotated Sorted Array (M) 题目 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5 阅读全文
posted @ 2020-06-25 05:42 墨云黑 阅读(160) 评论(0) 推荐(0)
摘要:Longest Valid Parentheses (H) 题目 Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parenth 阅读全文
posted @ 2020-06-25 04:03 墨云黑 阅读(113) 评论(0) 推荐(0)
摘要:Next Permutation (M) 题目 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such a 阅读全文
posted @ 2020-06-25 01:38 墨云黑 阅读(112) 评论(0) 推荐(0)
摘要:Substring with Concatenation of All Words (H) 题目 You are given a string, s, and a list of words, words, that are all of the same length. Find all star 阅读全文
posted @ 2020-06-24 11:18 墨云黑 阅读(156) 评论(0) 推荐(0)
摘要:Divide Two Integers (M) 题目 Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator. Retur 阅读全文
posted @ 2020-06-24 04:27 墨云黑 阅读(114) 评论(0) 推荐(0)
摘要:Implement strStr() (E) 题目 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 阅读全文
posted @ 2020-06-24 02:43 墨云黑 阅读(105) 评论(0) 推荐(0)
摘要:Remove Element (E) 题目 Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extr 阅读全文
posted @ 2020-06-24 02:00 墨云黑 阅读(113) 评论(0) 推荐(0)
摘要:Remove Duplicates from Sorted Array (E) 题目 Given a sorted array nums, remove the duplicates in-place such that each element appear only once and retur 阅读全文
posted @ 2020-06-24 01:38 墨云黑 阅读(97) 评论(0) 推荐(0)
摘要:Nim Game (E) 题目 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to re 阅读全文
posted @ 2020-06-23 07:31 墨云黑 阅读(108) 评论(0) 推荐(0)
摘要:Word Pattern (E) 题目 Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijec 阅读全文
posted @ 2020-06-23 04:32 墨云黑 阅读(123) 评论(0) 推荐(0)
摘要:Peeking Iterator (M) 题目 Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the 阅读全文
posted @ 2020-06-23 03:17 墨云黑 阅读(132) 评论(0) 推荐(0)
摘要:Move Zeroes (E) 题目 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero element 阅读全文
posted @ 2020-06-22 05:39 墨云黑 阅读(90) 评论(0) 推荐(0)
摘要:Reverse Nodes in k-Group (H) 题目 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive inte 阅读全文
posted @ 2020-06-22 03:45 墨云黑 阅读(132) 评论(0) 推荐(0)
摘要:Swap Nodes in Pairs (M) 题目 Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes, 阅读全文
posted @ 2020-06-22 02:56 墨云黑 阅读(133) 评论(0) 推荐(0)
摘要:Merge k Sorted Lists (H) 题目 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4- 阅读全文
posted @ 2020-06-22 02:23 墨云黑 阅读(85) 评论(0) 推荐(0)
摘要:Generate Parentheses (M) 题目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given 阅读全文
posted @ 2020-06-22 01:20 墨云黑 阅读(74) 评论(0) 推荐(0)
摘要:Perfect Squares (M) 题目 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Exa 阅读全文
posted @ 2020-06-21 07:42 墨云黑 阅读(104) 评论(0) 推荐(0)
摘要:Merge Two Sorted Lists (E) 题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of 阅读全文
posted @ 2020-06-21 06:07 墨云黑 阅读(166) 评论(0) 推荐(0)
摘要:Valid Parentheses (E) 题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An inp 阅读全文
posted @ 2020-06-21 05:52 墨云黑 阅读(134) 评论(0) 推荐(0)
摘要:Remove Nth Node From End of List (M) 题目 Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list 阅读全文
posted @ 2020-06-21 05:27 墨云黑 阅读(138) 评论(0) 推荐(0)
摘要:4Sum (M) 题目 Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b+ c + d = target? Find a 阅读全文
posted @ 2020-06-21 03:31 墨云黑 阅读(118) 评论(0) 推荐(0)
摘要:First Bad Version (E) 题目 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your pr 阅读全文
posted @ 2020-06-20 06:00 墨云黑 阅读(76) 评论(0) 推荐(0)
摘要:Integer to English Words (H) 题目 Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. 阅读全文
posted @ 2020-06-20 05:49 墨云黑 阅读(98) 评论(0) 推荐(0)
摘要:Letter Combinations of a Phone Number (M) 题目 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the num 阅读全文
posted @ 2020-06-20 04:42 墨云黑 阅读(130) 评论(0) 推荐(0)
摘要:3Sum Closest (M) 题目 Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Retur 阅读全文
posted @ 2020-06-20 03:17 墨云黑 阅读(115) 评论(0) 推荐(0)
摘要:3Sum (M) 题目 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 阅读全文
posted @ 2020-06-20 02:44 墨云黑 阅读(164) 评论(0) 推荐(0)
摘要:Different Ways to Add Parentheses (M) 题目 Given a string of numbers and operators, return all possible results from computing all the different possibl 阅读全文
posted @ 2020-06-19 11:35 墨云黑 阅读(259) 评论(0) 推荐(0)
摘要:Longest Common Prefix (E) 题目 Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, retu 阅读全文
posted @ 2020-06-19 08:07 墨云黑 阅读(163) 评论(0) 推荐(0)
摘要:Roman to Integer (E) 题目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 阅读全文
posted @ 2020-06-19 07:49 墨云黑 阅读(115) 评论(0) 推荐(0)
摘要:Container With Most Water (M) 题目 Given n non-negative integers \(a_1, a_2, ..., a_n\) , where each represents a point at coordinate \((i, a_i)\). n ve 阅读全文
posted @ 2020-06-19 07:21 墨云黑 阅读(93) 评论(0) 推荐(0)
摘要:Regular Expression Matching (H) Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' M 阅读全文
posted @ 2020-06-19 06:54 墨云黑 阅读(108) 评论(0) 推荐(0)
摘要:Integer to Roman (M) 题目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 阅读全文
posted @ 2020-06-18 10:25 墨云黑 阅读(202) 评论(0) 推荐(0)
摘要:Bulls and Cows (E) 题目 You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what th 阅读全文
posted @ 2020-06-18 08:37 墨云黑 阅读(264) 评论(0) 推荐(0)
摘要:H-Index (M) 题目 Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-i 阅读全文
posted @ 2020-06-18 06:58 墨云黑 阅读(258) 评论(0) 推荐(0)
摘要:Missing Number (E) 题目 Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: 阅读全文
posted @ 2020-06-17 08:27 墨云黑 阅读(202) 评论(0) 推荐(0)
摘要:Palindrome Number (E) 题目 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 阅读全文
posted @ 2020-06-17 06:48 墨云黑 阅读(136) 评论(0) 推荐(0)
摘要:String to Integer (atoi) (M) 题目 Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as nec 阅读全文
posted @ 2020-06-17 06:35 墨云黑 阅读(234) 评论(0) 推荐(0)
摘要:House Robber II (M) 题目 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All hous 阅读全文
posted @ 2020-06-17 01:25 墨云黑 阅读(47) 评论(0) 推荐(0)
摘要:House Robber (E) 题目 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only co 阅读全文
posted @ 2020-06-16 10:16 墨云黑 阅读(143) 评论(0) 推荐(0)
摘要:Repeated DNA Sequences (M) 题目 All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying D 阅读全文
posted @ 2020-06-16 10:15 墨云黑 阅读(133) 评论(0) 推荐(0)
摘要:Reverse Integer (E) 题目 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: - 阅读全文
posted @ 2020-06-16 03:12 墨云黑 阅读(62) 评论(0) 推荐(0)
摘要:ZigZag Conversion (M) 题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this 阅读全文
posted @ 2020-06-15 13:12 墨云黑 阅读(105) 评论(0) 推荐(0)
摘要:Median of Two Sorted Arrays (H) 题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. 阅读全文
posted @ 2020-06-15 13:10 墨云黑 阅读(81) 评论(0) 推荐(0)
摘要:Longest Substring Without Repeating Characters (M) 题目 Given a string, find the length of the longest substring without repeating characters. Example 1 阅读全文
posted @ 2020-06-15 13:09 墨云黑 阅读(79) 评论(0) 推荐(0)
摘要:Add two numbers (M) 题目 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and eac 阅读全文
posted @ 2020-06-15 13:02 墨云黑 阅读(103) 评论(0) 推荐(0)
摘要:Two Sum (E) 题目 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each inpu 阅读全文
posted @ 2020-06-15 13:01 墨云黑 阅读(68) 评论(0) 推荐(0)
摘要:Longest Palindromic Substring (M) 题目 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 100 阅读全文
posted @ 2020-06-15 11:31 墨云黑 阅读(31) 评论(0) 推荐(0)