Sum of minimum and maximum elements of all subarrays of size k

Problem Statement The problem “Sum of minimum and maximum elements of all subarrays of size k” states that you are given an array containing positive and negative integers, find the sum of minimum and maximum elements of all the sub-arrays of size k. Examples arr[] = {5, 9, 8, 3, …

Read more

Minimum number of subsets with distinct elements

Problem Statement Suppose you have an array of integers of size n. The problem statement asks to find out the minimum number of subsets with distinct elements, that is subsets that can be formed which contain all the different/distinct elements from the array. Example arr[] = {2,4,6,2,1,4,2} 3 Explanation: {1, …

Read more

Translate »