10 2020 档案
摘要:Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to th
阅读全文
摘要:In a gold mine grid of size m * n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty. Return the ma
阅读全文
摘要:You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that th
阅读全文
摘要:Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo
阅读全文
摘要:Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string.
阅读全文
摘要:Given a string s, return the last substring of s in lexicographical order. Example 1: Input: "abab" Output: "bab" Explanation: The substrings are ["a"
阅读全文
摘要:A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). Given a starting point (sx, sy) and a target point (tx, t
阅读全文
摘要:A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by heigh
阅读全文
摘要:We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup
阅读全文
摘要:Alice and Bob take turns playing a game, with Alice starting first. Initially, there are n stones in a pile. On each player's turn, that player makes
阅读全文
摘要:You start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] donates th
阅读全文
摘要:Let's call any (contiguous) subarray B (of A) a mountain if the following properties hold: B.length >= 3 There exists some 0 < i < B.length - 1 such t
阅读全文
摘要:Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm th
阅读全文
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep
阅读全文
摘要:You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int
阅读全文
摘要:Your friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed
阅读全文
摘要:Given the root of a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any one
阅读全文
摘要:You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), w
阅读全文
摘要:Given a string s, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them causing the left and the right side
阅读全文
摘要:Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make
阅读全文
摘要:Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any
阅读全文
摘要:Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false. Swapping letters i
阅读全文
摘要:Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. Exampl
阅读全文
摘要:You are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix
阅读全文
摘要:There is an infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indicates that there is a bidirecti
阅读全文
摘要:A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and
阅读全文
摘要:Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicogr
阅读全文
摘要:Implement the class UndergroundSystem that supports three methods: 1. checkIn(int id, string stationName, int t) A customer with id card equal to id,
阅读全文
摘要:Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + ar
阅读全文
摘要:Implement a SnapshotArray that supports the following interface: SnapshotArray(int length) initializes an array-like data structure with the given len
阅读全文
摘要:You are given a string s. Reorder the string using the following algorithm: Pick the smallest character from s and append it to the result. Pick the s
阅读全文
摘要:You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal
阅读全文
摘要:Implement the BSTIterator class that represents an iterator over the in-order traversal of a binary search tree (BST): BSTIterator(TreeNode root) Init
阅读全文
摘要:Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in t
阅读全文
摘要:Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle
阅读全文
摘要:Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different arrays (each array picks one) and cal
阅读全文
摘要:You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the RecentCounter class: RecentCounte
阅读全文

浙公网安备 33010602011771号