Fenwick Tree
Twenty questions on Fenwick trees (binary indexed trees), a compact alternative to segment trees for prefix-sum queries.
Count Number of Rectangles Containing Each Point
mediumYou are given a 2D integer array rectangles where rectangles[i] = [li, hi] indicates that ith rectangle has a length of li and a height of hi.
Count Number of Teams
mediumThere are n soldiers standing in a line.
Maximum Area Rectangle With Point Constraints I
mediumYou are given an array points where points[i] = [xi, yi] represents the coordinates of a point on an infinite plane.
Number of Longest Increasing Subsequence
mediumGiven an integer array nums, return the number of longest increasing subsequences.
Queries on a Permutation With Key
mediumGiven the array queries of positive integers between 1 and m, you have to process all queries[i] (from i=0 to i=queries.length-1) according to the following rules: Return an array...
Queue Reconstruction by Height
mediumYou are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order).
Alternating Groups III
hardThere are some red and blue tiles arranged circularly.
Block Placement Queries
hardThere exists an infinite number line, with its origin at 0 and extending towards the positive x-axis.
Count Good Triplets in an Array
hardYou are given two 0-indexed arrays nums1 and nums2 of length n, both of which are permutations of [0, 1, ..., n - 1].
Count Increasing Quadruplets
hardGiven a 0-indexed integer array nums of size n containing all numbers from 1 to n, return the number of increasing quadruplets.
Count of Range Sum
hardGiven an integer array nums and two integers lower and upper, return the number of range sums that lie in [lower, upper] inclusive.
Count of Smaller Numbers After Self
hardGiven an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].
Create Sorted Array through Instructions
hardGiven an integer array instructions, you are asked to create a sorted array from the elements in instructions.
Distribute Elements Into Two Arrays II
hardYou are given a 1-indexed array of integers nums of length n.
Find Building Where Alice and Bob Can Meet
hardYou are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building.
Find the Longest Valid Obstacle Course at Each Position
hardYou want to build some obstacle courses.
Longest Increasing Subsequence II
hardYou are given an integer array nums and an integer k.
Make Array Empty
hardYou are given an integer array nums containing distinct numbers, and you can perform the following operations until the array is empty: Return an integer denoting the number of...
Maximum Area Rectangle With Point Constraints II
hardThere are n points on an infinite plane.
Maximum Balanced Subsequence Sum
hardYou are given a 0-indexed integer array nums.