## How to evenly put N objects into N places with adjacent moves

Suppose you have N objects distributed unevenly in N containers. You can move one object from a container to an adjacent container, it is considered… Read More »

- Make all numbers of an array equal
- Optimal Strategy for a Game | Set 2
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Sum of XOR of all subarrays
- Find k closest numbers in an unsorted array
- Count pairs in array whose sum is divisible by K
- Building Heap from Array
- Amazon Internship Interview Experience
- Program for K Most Recently Used (MRU) Apps
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Longest subsequence such that adjacent elements have at least one common digit
- k-th missing element in an unsorted array
- Minimum operations required to make all the array elements equal
- Count of pairs (x, y) in an array such that x < y
- Maximum sum such that no two elements are adjacent | Set 2
- Number of unique pairs in an array
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Merge K sorted arrays of different sizes | ( Divide and Conquer Approach )
- Maximum element in a sorted and rotated array
- Length of the longest alternating subarray
- Minimum elements to be removed such that sum of adjacent elements is always even
- Given two arrays count all pairs whose sum is an odd number
- Array Manipulation and Sum
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Sort an array without changing position of negative numbers
- Count array elements that divide the sum of all other elements
- Create linked list from a given array
- Find minimum difference between any two elements | Set 2
- Find two numbers whose divisors are given in a random order
- Maximum absolute difference in an array

Suppose you have N objects distributed unevenly in N containers. You can move one object from a container to an adjacent container, it is considered… Read More »

Given N numbers and two numbers L and R., the task is to print the count of numbers in the range [L, R] which are… Read More »

Given an array arr[] of N integers. The task is to count the total number of subarrays of the given array such that difference between… Read More »

Given an array arr[] of n integers, construct a Sum Array sum[] (of same size) such that sum[i] is equal to the sum of all… Read More »

Given an array arr[] of N elements. The task is to check if the array is PalinArray or not i.e., if all elements of array… Read More »

Given three arrays names[], marks[] and updates[] where: names[] contains the names of students. marks[] contains the marks of the same students. updates[] contains the… Read More »

Given an array arr[] of size n ≥ 3, the task is to find the minimum possible difference between the maximum and the minimum element… Read More »

Given an array of integers arr[], the task is to count all the pairs (arr[i], arr[j]) such that i + j = arr[i] + arr[j]… Read More »

Given integers k, d1, d2 and an integer array arr[]. Starting from number k you are allowed to make jumps of size d1 and d2… Read More »

Given an array arr[], the task is to count all the valid pairs from the array. A pair (arr[i], arr[j]) is said to be valid… Read More »

Given an array of N integers and 3 integers D, A and B. The task is to find the number of array elements that we… Read More »

Given an array of integers. Find an integer X which is the divisor of all except for exactly one element in the given array. Note:… Read More »

Given an array arr[] in which XOR of every 2 consecutive elements of the original array is given i.e if the total number of elements… Read More »

Python provides many ways to create 2-dimensional lists/arrays. However one must know the differences between these ways because they can create complications in code that… Read More »

Given a array arr[], the task is to count the numbers which can be made power of 2 with the following operation: 1 can be… Read More »