3–Partition Problem
Given a set S
of positive integers, determine if it can be partitioned into three disjoint subsets that all have the same sum, and they cover S
.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a set S
of positive integers, determine if it can be partitioned into three disjoint subsets that all have the same sum, and they cover S
.
Given a linear equation of k
variables, count the total number of possible solutions to it. The problem is similar to finding the total number of ways to get the denomination of coins. Here, coefficients of an equation can be considered coins denominations, and the RHS of an equation can be considered the desired change.
The longest decreasing subsequence problem is to find a subsequence of a given sequence in which the subsequence’s elements are in sorted order, highest to lowest, and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous or unique.
Given a list containing future predictions of share prices, find the maximum profit earned by buying and selling shares at most twice with a constraint that a new transaction can only start after the previous transaction complete, i.e., we can only hold at most one share at a time.
Given a list containing future predictions of share prices, find the maximum profit earned by buying and selling shares at most k
times with a constraint that a new transaction can only start after the previous transaction is complete, i.e., we can only hold at most one share at a time.
Given three strings, return true if the third string is interleaving the first and second strings, i.e., it is formed from all characters of the first and second string, and the order of characters is preserved.
Implement your diff utility, i.e., given two similar strings, efficiently list out all differences between them. The diff utility is a data comparison tool that calculates and displays the differences between the two texts.
Write an efficient algorithm to check if a given string is k–palindrome or not. A string is k–palindrome if it becomes a palindrome on removing at most k
characters from it.
Given a mobile keypad having digits from 0 to 9 associated with each key, count total possible combinations of digits having length n
. We can start with any digit and press only four adjacent keys of any digit. The keypad also contains *
and #
keys, which we are not allowed to press.
Write an algorithm to replace each element in an array of positive integers such that the difference between adjacent elements in the array is less than or equal to a given target. The goal is to minimize the adjustment cost, which is the sum of differences between new and old values.
The Longest Common Subsequence (LCS) problem is finding the longest subsequence present in given two sequences in the same order, i.e., find the longest sequence which can be obtained from the first original sequence by deleting some items and from the second original sequence by deleting other items.
Given a dictionary of words, determine if a given string can be segmented into a space-separated sequence of one or more dictionary words.