2418. Sort the People
You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n. For each […]
You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n. For each […]
Given a binary tree. Find the size of its largest subtree which is a Binary Search Tree.Note: Here Size equals the number of
You are given a positive integer k. You are also given: a 2D integer array rowConditions of size n where rowConditions[i] = [abovei, belowi], and a 2D integer
Given an array arr. The task is to find and return the maximum product possible with the subset of elements present in the
You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the ith row and colSum[j] is the sum of the
You are given a binary tree and you need to remove all the half nodes (which have only one child). Return the
Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order. A lucky number is an element of the matrix such that it
Given an array arr containing positive integers. Count and return an array ans where ans[i] denotes the number of smaller elements on right side of arr[i]. Examples:
You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is
You are given an array arr. Your task is to find the longest length of a good sequence. A good sequence {x1, x2, .. xn}
Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a
Given an array parent that is used to represent a tree. The array indices (0-based indexing) are the values of the tree