Find all increasing subsequences of an array
Given an integer array, find all distinct increasing subsequences of length two or more.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven an integer array, find all distinct increasing subsequences of length two or more.
Insert the specified interval into a collection of non-overlapping intervals that has been organized by the start time of each interval. If the new interval causes intervals to overlap, merge the overlapped intervals.
Find the duplicate numbers in an integer array of size n that contains elements between 1 and n, at least one of which repeats.
Given an array of distinct positive integers, find the total number of distinct permutations that add up to a given target, where each array element may be used any number of times.
Given four integer arrays, count the number of quadruplets with a zero sum, including exactly one element from each array.
Given a positive integer n and a target, find all combinations of distinct numbers in the interval [1,9] of length n that add up to the target.
Given an integer array, find the length of the longest subsequence with alternate low and high elements in the array.
Given an integer array, shrink it by removing adjacent triplets that satisfy the given constraints and return the total number of elements in the resultant array.
Given a list of non-negative integers, find the minimum number of merge operations to make it a palindrome. A merge operation can only be performed on two adjacent elements and replace them with their sum.
Given a list of database transactions, find all read-write conflicts among them. Assume that there is no strict two-phase locking (Strict 2PL) protocol to prevent read-write conflicts.
Given an array representing the parent-child relationship in a binary tree, find the tree’s height without building it. The parent-child relationship is defined by (A[i], i) for every index i in array A.
Given an array representing the preorder traversal of a BST, determine whether it represents a skewed BST or not. In a skewed BST, each node’s descendants are either smaller or larger than the node itself.