Count subarrays having total distinct elements same as original array

Problem Statement   “Count subarrays having total distinct elements same as original array” states that you are given an integer array. The problem statement asks to find out the total number of sub-arrays that contain all distinct elements as present in an original array. Example   arr[] = {2, 1, 3, 2, …

Read more

Count pairs from two sorted arrays whose sum is equal to a given value x

Problem Statement   “Count pairs from two sorted arrays whose sum is equal to a given value x” problem states that you are given two sorted arrays of integers and an integer value called sum. The problem statement asks to find out the total number of pair which sums up to …

Read more