Decode an array constructed from another array
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.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven 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.
Find the largest number possible from a set of given numbers where the numbers append to each other in any order to form the largest number.
Given an array of positive integers, find the smallest subarray’s length whose sum of elements is greater than a given number k.
Given an integer array, find a subarray having a given sum in it.
Given an integer array, find the minimum sum subarray of size k, where k is a positive integer.
Given a binary array, find the maximum sequence of continuous 1’s that can be formed by replacing at most k zeros by ones.
Given an integer array, find all distinct combinations of a given length k, where the repetition of elements is allowed.
Given an integer array, find all distinct combinations of a given length k. The program should print only distinct combinations.
Given an integer array, find the maximum difference between two elements in it such that the smaller element appears before the larger element.
The Longest Bitonic Subarray (LBS) problem is to find a subarray of a given sequence in which the subarray’s elements are first sorted in increasing order, then in decreasing order, and the subarray is as long as possible.
Given an integer array, find the largest subarray formed by consecutive integers. The subarray should contain all distinct values.
Given a limited range array of size n and containing elements between 1 and n-1 with one element repeating, find the duplicate number in it without using any extra space.