307. Range Sum Query - Mutable Description Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums by updating the element at index i to val. E...
911. Online Election Description In an election, the i-th vote was cast for persons[i] at time times[i]. Now, we would like to implement the following query function: TopVotedCandidate.q(int t) will return the number of t...
926. Flip String to Monotone Increasing Description A string of '0’s and '1’s is monotone increasing if it consists of some number of '0’s (possibly 0), followed by some number of '1’s (also possibly 0.) We are given a string S of '0’s and ...
933. Number of Recent Calls Description Write a class RecentCounter to count recent requests. It has only one method: ping(int t), where t represents some time in milliseconds. Return the number of pings that have been made from...
939. Minimum Area Rectangle Description Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes. If there isn’t any rectangle, return 0. ...
890. Find and Replace Pattern Description You have a list of words and a pattern, and you want to know which words in words matches the pattern. A word matches the pattern if there exists a permutation of letters p so that after r...
853. Car Fleet Description N cars are going to the same destination along a one lane road. The destination is target miles away. Each car i has a constant speed speed[i] (in miles per hour), and initial position po...
849. Maximize Distance to Closest Person Description In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. There is at least one empty seat, and at least one person sitting. Alex wants to sit...
846. Hand of Straights Description Alice has a hand of cards, given as an array of integers. Now she wants to rearrange the cards into groups so that each group is size W, and consists of W consecutive cards. Return true if...
846. Hand of Straights Description Alice has a hand of cards, given as an array of integers. Now she wants to rearrange the cards into groups so that each group is size W, and consists of W consecutive cards. Return true if...
837. New 21 Game Description Alice plays the following game, loosely based on the card game “21”. Alice starts with 0 points, and draws numbers while she has less than K points. During each draw, she gains an integer...
834. Sum of Distances in Tree Description An undirected, connected tree with N nodes labelled 0…N-1 and N-1 edges are given. The ith edge connects nodes edges[i][0] and edges[i][1] together. Return a list ans, where ans[i] is the ...
815. Bus Routes Description We have a list of bus routes. Each routes[i] is a bus route that the i-th bus repeats forever. For example if routes[0] = [1, 5, 7], this means that the first bus (0-th indexed) travels in...
774. Minimize Max Distance to Gas Station Description On a horizontal number line, we have gas stations at positions stations[0], stations[1], …, stations[N-1], where N = stations.length. Now, we add K more gas stations so that D, the maximum...
769. Max Chunks To Make Sorted Description Given an array arr that is a permutation of [0, 1, …, arr.length - 1], we split the array into some number of “chunks” (partitions), and individually sort each chunk. After concatenating ...
769. Max Chunks To Make Sorted Description Given an array arr that is a permutation of [0, 1, …, arr.length - 1], we split the array into some number of “chunks” (partitions), and individually sort each chunk. After concatenating ...
750. Number Of Corner Rectangles Description Given a grid where each entry is only 0 or 1, find the number of corner rectangles. A corner rectangle is 4 distinct 1s on the grid that form an axis-aligned rectangle. Note that only the ...
731. My Calendar II Description Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple booking. Your class will have one method, book(int start, int end...
685. Redundant Connection II Description In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one p...
684. Redundant Connection Description In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree with N nodes (with distinct values 1, 2, …, N), with o...