Find Smallest Range Containing Elements from k Lists

In the problem “Find the smallest range containing elements from k lists” we have given K lists which are sorted and of the same size N. It asks to determine the smallest range that contains at least element(s) from each of the K lists. If there is more than one …

Read moreFind Smallest Range Containing Elements from k Lists

Range Minimum Query (Square Root Decomposition and Sparse Table)

In the range minimum query problem we have given a query and an integer array. Each query contains the range as left and right indexes for each range. The given task is to determine the minimum of all number that lies within the range. Example Input: arr[] = {2, 5, …

Read moreRange Minimum Query (Square Root Decomposition and Sparse Table)

LCS (Longest Common Subsequence) of three strings

The problem “LCS (Longest Common Subsequence) of three strings” states that you are given 3 strings. Find out the longest common subsequence of these 3 strings. LCS is the string that is common among the 3 strings and is made of characters having the same order in all of the …

Read moreLCS (Longest Common Subsequence) of three strings