Longest Common Subsequence with Permutations

Problem Statement In the “Longest Common Subsequence with Permutations” problem we have given two strings “s” and “t”. Find the longest string whose permutations are sub-sequences of the given two strings. Output longest must be sorted. Input Format The first line containing a string “s”. The second line containing a …

Read more

Find the Lost Element From a Duplicated Array

Problem Statement Given two arrays A and B, one array is a duplicate of the other except one element. The one element is missing from either A or B. we need to find the lost element from a duplicated array. Example 5 1 6 4 8 9 6 4 8 …

Read more

Smallest Positive Number Missing in an Unsorted Array

Problem Statement In the given unsorted array find the smallest positive number missing in an unsorted array. A positive integer doesn’t include 0. We can modify the original array if needed. The array may contain positive and negative numbers. Example a. Input array : [3, 4, -1, 0, -2, 2, 1, …

Read more

Find Smallest Missing Number in a Sorted Array

Problem Statement In the “Find Smallest Missing Number in a Sorted Array” problem we have given an integer array. Find the smallest missing number in N sized sorted array having unique elements in the range of 0 to M-1, where M>N. Example Input [0, 1, 2, 3, 4, 6, 7, …

Read more

Translate »