Given an array of pairs of integers, find all symmetric pairs, i.e., pairs that mirror each other. For instance, pairs `(x, y)` and `(y, x)` are mirrors of each other.
Given an array and an integer `k`, find the count of distinct elements in every subarray of size `k`.. We know that a set doesn't store duplicate elements...
Given an integer array between 0 and 9, find two numbers with maximum sum formed using all the array digits. The difference in the number of digits of the two numbers should be ± 1.
Given an integer array, print all maximum size subarrays having all distinct elements in them. The problem differs from the problem of finding the maximum size subsequence with distinct elements.
Given an unsorted integer array, find two non-overlapping pairs in it having the same sum.. For example, for input array { 3, 4, 7, 3, 4 }, the two non-overlapping pairs are (4, 3) and (3, 4).
Given an unsorted integer array of size `n`, whose elements lie in the range 0 to `n-1`, rearrange the array such that `A[A[i]]` is set to `i` for every array element `A[i]`.
Given an array, reverse every group of consecutive `m` elements in a given subarray of it. For example, consider the array { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } and m = 3. Then, for subarray [i, j], where i = 1, j = 7 or 8, output is {4, 3, 2, 7, 6, 5, 8, 9, 10}.
Given an integer array, find a subset in it having the maximum product of its elements. For example, the output is 15360 for array {-6, 4, -5, 8, -10, 0, 8}.
Given two binary arrays, `X` and `Y`, find the length of the longest continuous sequence that starts and ends at the same index in both arrays and have the same sum.
Given a list containing future prediction of share prices, find the maximum profit earned by buying and selling shares any number of times with the constraint, a new transaction can only start after the previous transaction is complete.
Given a schedule containing the arrival and departure time of trains in a station, find the minimum number of platforms needed to avoid delay in any train's arrival.
Given two sorted arrays of integers, find a maximum sum path involving elements of both arrays whose sum is maximum. We can start from either array, but we can switch between arrays only through its common elements.
Given an array constructed from another array by taking the sum of every distinct pair in it, decode the array to get back the original array elements.
Given an integer array, find a subarray having a given sum in it. We can solve this problem by using a sliding window. The idea is to maintain a window that starts from the current element, and the sum of its elements is more than or equal to the given sum.
Given an integer array, find the minimum product among all combinations of triplets in the array.. The idea is to take the help of four auxiliary arrays of the same size as the input array..