Top View of a Tree
Given a binary tree root, return the top view of the tree, sorted left-to-right.
Given a binary tree root, return the top view of the tree, sorted left-to-right.
Given two lowercase alphabet strings s1 and s2, determine if s1 is a subsequence of s2.
You are given a list of integers positions representing the position of a car at equally spaced intervals of time. Return the length of the longest sublist w...
Given a lowercase alphabet string s and an integer k, you want to divide the string into k disjoint parts such that each part is a palindrome. Return the min...
Given a 2-d array matrix, return elements in spiral order starting from matrix[0][0].
Given a list of integers nums, order nums by frequency, with most frequent values coming first. If there’s a tie in frequency, higher valued numbers should c...
You are given a two-dimensional list of integers matrix where each row is sorted in ascending order. Return the smallest number that exists in every row. If ...
Given strings a and b, return the length of the shortest string that has both a and b as subsequences.
You are given two lists of integers weights and values which have the same length and an integer capacity. weights[i] and values[i] represent the weight and ...
Given a string digits containing 2 to 9 inclusive, return in sorted lexicographic order all possible strings it could represent when mapping to letters on a ...
Given a list of integers nums, return the number of sublists where the first element is not bigger than other numbers in the sublist.
You are given a two-dimensional list of integers matrix. Return the minimum sum you can get by taking a number in each row with the constraint that any row-a...