Coding Exercise Posts - page 11 of 43

Recent posts

Top View of a Tree

less than 1 minute read

Given a binary tree root, return the top view of the tree, sorted left-to-right.

Subsequence Strings

less than 1 minute read

Given two lowercase alphabet strings s1 and s2, determine if s1 is a subsequence of s2.

Steady Speed

1 minute read

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...

Split String Into K Palindromes

less than 1 minute read

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...

Spiral Matrix

less than 1 minute read

Given a 2-d array matrix, return elements in spiral order starting from matrix[0][0].

Sort by Frequency and Value

1 minute read

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...

Smallest Intersecting Element

less than 1 minute read

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 ...

Shortest Common Supersequence

less than 1 minute read

Given strings a and b, return the length of the shortest string that has both a and b as subsequences.

Poly Knapsack

1 minute read

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 ...

Phone Number Combinations

less than 1 minute read

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 ...

Number of Sublists With Small Left Value

less than 1 minute read

Given a list of integers nums, return the number of sublists where the first element is not bigger than other numbers in the sublist.

Minimum Dropping Path Sum

1 minute read

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...