12 2019 档案
摘要:原题链接在这里:https://leetcode.com/problems/design-snake-game/ 题目: Design a Snake game that is played on a device with screen size = width x height. Play th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/fibonacci-number/ 题目: The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequenc
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/ 题目: You have k lists of sorted integers in ascending order. Find
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-area-rectangle-ii/ 题目: Given a set of points in the xy-plane, determine the minimum area of any rectangl
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-area-rectangle/ 题目: Given a set of points in the xy-plane, determine the minimum area of a rectangle for
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-window-subsequence/ 题目: Given strings s1 and s2, return the minimum contiguous substring part of s1, so
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/backspace-string-compare/ 题目: Given two strings S and T, return if they are equal when both are typed into empty
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/valid-tic-tac-toe-state/ 题目: A Tic-Tac-Toe board is given as a string array board. Return True if and only if it
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/design-search-autocomplete-system/ 题目: Design a search autocomplete system for a search engine. Users may input
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-absolute-file-path/ 题目: Suppose we abstract our file system by a string in the following manner: The str
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/rotated-digits/ 题目: X is a good number if after rotating each digit individually by 180 degrees, we get a valid
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/design-circular-deque/ 题目: Design your implementation of the circular double-ended queue (deque). Your implement
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/design-circular-queue/ 题目: Design your implementation of the circular queue. The circular queue is a linear data
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/remove-outermost-parentheses/ 题目: A valid parentheses string is either empty (""), "(" + A + ")", or A + B, wher
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/defanging-an-ip-address/ 题目: Given a valid (IPv4) IP address, return a defanged version of that IP address. A de
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-pivot-index/ 题目: Given an array of integers nums, write a method that returns the "pivot" index of this arr
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/check-if-a-number-is-majority-element-in-a-sorted-array/ 题目: Given an array nums sorted in non-decreasing order,
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/peak-index-in-a-mountain-array/ 题目: Let's call an array A a mountain if the following properties hold: A.length
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/smallest-common-region/ 题目: You are given some lists of regions where the first region of each list includes all
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/coloring-a-border/ 题目: Given a 2-dimensional grid of integers, each value in the grid represents the color of th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/design-tic-tac-toe/ 题目: Design a Tic-tac-toe game that is played between two players on a n x n grid. You may as
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/ 题目: There are a number of spherical balloons spread in two-dimension
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/flood-fill/ 题目: An image is represented by a 2-D array of integers, each integer representing the pixel value of
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/squares-of-a-sorted-array/ 题目: Given an array of integers A sorted in non-decreasing order, return an array of t
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/contiguous-array/ 题目: Given a binary array, find the maximum length of a contiguous subarray with equal number o
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/spiral-matrix-iii/ 题目: On a 2 dimensional grid with R rows and C columns, we start at (r0, c0) facing east. Here
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/stickers-to-spell-word/ 题目: We are given N different types of stickers. Each sticker has a lowercase English wor
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/single-element-in-a-sorted-array/ 题目: You are given a sorted array consisting of only integers where every eleme
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/toeplitz-matrix/ 题目: A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element.
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/valid-square/ 题目: Given the coordinates of four points in 2D space, return whether the four points could constru
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/intersection-of-three-sorted-arrays/ 题目: Given three integer arrays arr1, arr2 and arr3 sorted in strictly incre
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/unique-paths-iii/ 题目: On a 2-dimensional grid, there are 4 types of squares: 1 represents the starting square. T
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-the-town-judge/ 题目: In a town, there are N people labelled from 1 to N. There is a rumor that one of these
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/pancake-sorting/ 题目: Given an array A, we can perform a pancake flip: We choose some positive integer k <= A.len
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/ 题目: Given a rooted binary tree, return the lowest common ancestor of i
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/maximum-vacation-days/ 题目: LeetCode wants to give one of its best employees the option to travel among N cities
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/snapshot-array/ 题目: Implement a SnapshotArray that supports the following interface: SnapshotArray(int length) i
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/robot-room-cleaner/ 题目: Given a robot cleaner in a room modeled as a grid. Each cell in the grid can be empty or
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/valid-palindrome-iii/ 题目: Given a string s and an integer k, find out if the given string is a K-Palindrome or n
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/ 题目: Given a string S of '(' and ')' parentheses, we add the minimum numbe
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/range-sum-of-bst/ 题目: Given the root node of a binary search tree, return the sum of values of all nodes with va
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/car-pooling/ 题目: You are driving a vehicle that has capacity empty seats initially available for passengers. The
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/random-pick-with-weight/ 题目: Given an array w of positive integers, where w[i] describes the weight of index i,
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/linked-list-random-node/ 题目: Given a singly linked list, return a random node's value from the linked list. Each
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/random-pick-index/ 题目: Given an array of integers with possible duplicates, randomly output the index of a given
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-common-characters/ 题目: Given an array A of strings made only from lowercase letters, return a list of all c
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/diagonal-traverse/ 题目: Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix i
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/friends-of-appropriate-ages/ 题目: Some people will make friend requests. The list of their ages is given and ages
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/goat-latin/ 题目: A sentence S is given, composed of words separated by spaces. Each word consists of lowercase an
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/monotonic-array/ 题目: An array is monotonic if it is either monotone increasing or monotone decreasing. An array
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/ 题目: Given a binary tree, return the vertical order traversal of its n
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/maximum-sum-of-3-non-overlapping-subarrays/ 题目: In a given array nums of positive integers, find three non-overl
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/exclusive-time-of-functions/ 题目: On a single threaded CPU, we execute some functions. Each function has a unique
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/verifying-an-alien-dictionary/ 题目: In an alien language, surprisingly they also use english lowercase letters, b
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/basic-calculator-iii/ 题目: Implement a basic calculator to evaluate a simple expression string. The expression st
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/swap-for-longest-repeated-character-substring/ 题目: Given a string text, we are allowed to swap two of the charac
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/word-subsets/ 题目: We are given two arrays A and B of words. Each word is a string of lowercase letters. Now, say
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/reorganize-string/ 题目: Given a string S, check if the letters can be rearranged so that two characters that are
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-repeating-substring/ 题目: Given a string S, find out the length of the longest repeating substring(s). Re
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/score-of-parentheses/ 题目: Given a balanced parentheses string S, compute the score of the string based on the fo
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/ 题目: Given a string s of '(' , ')' and lowercase English characters. Yo
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/custom-sort-string/ 题目: S and T are strings composed of lowercase letters. In S, no letter occurs more than once
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters/ 题目: Given a string S, return the number of substrings of l
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-and-replace-pattern/ 题目: You have a list of words and a pattern, and you want to know which words in words
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/ 题目: Return the lexicographically smallest subsequence of text that
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shifting-letters/ 题目: We have a string S of lowercase letters, and an integer array shifts. Call the shift of a
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/remove-comments/ 题目: Given a C++ program, remove comments from it. The program source is an array where source[i
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/replace-the-substring-for-balanced-string/ 题目: You are given a string containing only 4 kinds of characters 'Q',
阅读全文