##
Subsequence with maximum odd sum
April 22, 2017

Given a set of integers, check whether there is a subsequence with odd sum and if yes, then finding the maximum odd sum. If no… Read More »

April 22, 2017

Given a set of integers, check whether there is a subsequence with odd sum and if yes, then finding the maximum odd sum. If no… Read More »

April 20, 2017

Given an array of n integers containing only 0 and 1. Find the minimum toggles (switch from 0 to 1 or vice-versa) required such the… Read More »

Given an array of integers arr[] and a number m, count the number of subarrays having XOR of their elements as m. Examples: Input :… Read More »

April 18, 2017

Given an array representing n positions along a straight line. Find k (where k

You have an array of N numbers, where N is at most 32,000. The array may have duplicates entries and you do not know what… Read More »

April 16, 2017

This technique shows how a nested for loop in few problems can be converted to single for loop and hence reducing the time complexity. Let’s… Read More »

April 15, 2017

Given an array of integers and a sum, the task is to print all subsets of given array with sum equal to given sum. Examples:… Read More »

April 14, 2017

Given an array arr[], find a Noble integer in it. An integer x is said to be Noble in arr[] if the number of integers… Read More »

April 12, 2017

Find original array from a given encrypted array of size n. Encrypted array is obtained by replacing each element of the original array by the… Read More »

April 1, 2017

Given two arrays a[] and b[] of equal length n. The task is to pair each element of array a to an element in array… Read More »

March 31, 2017

Given an integer array with repeated elements, the task is to find sum of all distinct elements in array. Examples: Input : arr[] = {12,… Read More »

Pairwise sum of n (where n >= 3) numbers are given in a specified order, find the numbers. The order has pair sum of first… Read More »

Given an array of integers greater than zero, find if it is possible to split it in two subarrays (without reordering the elements), such that… Read More »

Given a sorted integer array and number x, the task is to count pairs in array whose sum is less than x. Examples: Input :… Read More »

March 30, 2017

Given an array of integers, we need to get total XOR of all subarray XORs where subarray XOR can be obtained by XORing all elements… Read More »