What is Framework?

The term ‘framework’, in general, refers to a basic structure that serves as support fo…

Find the longest subsequence formed by consecutive integers

Problem Given an array of integers, find the longest subsequence of consecutive integers. Sam…

Find duplicates within a range k in an array

Problem You are given an array of integers and a number k. You need to check if duplicates exist…

Count the number of strictly increasing subarrays in an array

Problem Given an array, count the total number of strictly increasing subarrays in it. Sample…

Shuffle an array according to the given order of elements

Problem Given two integer arrays of the same size, arr[] and index[], reorder elements in arr[] …

Find the smallest window in an array sorting which will make the enti…

Problem Given an integer array nums, identify one continuous subarray that, if just this subarra…

Find minimum sum of a subarray of size k

Problem Given an array of integers and a number k, find the minimum sum of a subarray of size k.…

Find equilibrium index of the array

Problem Calculate the equilibrium index of an array of integers. The equilibrium is the index…

Decode an array constructed from another array

Problem There is a hidden integer array arr that consists of n non-negative integers. It was enc…

Sort an almost sorted array where only two elements are swapped

Problem How can an almost-sorted array with only two members swapped be effectively sorted? S…

Reverse every consecutive m-elements of a subarray

Problem Given an array, reverse every sub-array formed by consecutive m elements. Sample Inpu…

4–Sum Problem | Quadruplets with a given sum

Problem The goal is to count all the quadruplets having a target sum S. Sample Input [2,…