##
Program to print an array in Pendulum Arrangement
May 10, 2017

Write a program to input a list of integers in an array and arrange them in a way similar to the to-and-fro movement of a… Read More »

May 10, 2017

Write a program to input a list of integers in an array and arrange them in a way similar to the to-and-fro movement of a… Read More »

Given an array of n positive distinct integers. The problem is to find the largest sum of contiguous increasing subarray in O(n) time complexity. Examples:… Read More »

Introduction and Implementation : Given an array arr[] of size n, its prefix sum array is another array prefixSum[] of same size such that the… Read More »

May 9, 2017

Given an array ‘arr1’ of n positive integers. Contents of arr1[] are copied to another array ‘arr2’, but numbers are shuffled and one element is… Read More »

May 7, 2017

Three arrays of same size are given. Find a triplet such that maximum – minimum in that triplet is minimum of all the triplets. A… Read More »

May 3, 2017

Given an array, the task is to find average of that array. Average is the sum of array elements divided by the number of elements.… Read More »

Given an array of size n, write a program to check if it is sorted in ascending order or not. Equal values are allowed in… Read More »

May 2, 2017

Given two positive integer n and n. The task is to find the number of arrays of size n that can be formed such that… 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 »