Category: data structure
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. …
Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. Example : Input: root = 5 …
Given an array A of integers, return true if and only if it is a valid mountain array. Recall that A is a mountain array if and only if: …
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input: S = …
Given an array A of 0s and 1s, consider N_i: the i-th subarray from A to A interpreted as a binary number (from most-significant-bit to least-significant-bit.) Return a list …