## Cyclic Iterator for K variable length vectors

Given K vectors, the task is to design a cyclic iterator that prints the elements of these vectors in a cyclic manner. For example: v1… Read More »

- Sort an array without changing position of negative numbers
- Kth smallest element in a subarray
- Introduction to Data Structures | 10 most commonly used Data Structures
- Find maximum xor of k elements in an array
- Find the longest string that can be made up of other strings from the array
- Find minimum difference between any two elements | Set 2
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Greatest contiguous sub-array of size K
- Remove duplicate elements in an Array using STL in C++
- Find the smallest positive number missing from an unsorted array | Set 3
- Maximum sum combination from two arrays
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Remove duplicates from unsorted array using Set data structure
- Pair with largest sum which is less than K in the array
- Iterative approach to print all permutations of an Array
- Find a triplet in an array whose sum is closest to a given number
- Divide the array in K segments such that the sum of minimums is maximized
- Rearrange numbers in an array such that no two adjacent numbers are same
- Find the minimum number of moves to reach end of the array
- Find the minimum number of elements that should be removed to make an array good
- Sum of digits with even number of 1's in their binary representation
- Find XOR of numbers from the range [L, R]
- Minimum number of Fibonacci jumps to reach end
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Count pairs with given sum | Set 2
- Reduce number to a single digit by subtracting adjacent digits repeatedly
- Find sum of a[i]%a[j] for all valid pairs
- Count smaller elements on right side and greater elements on left side using Binary Index Tree

Given K vectors, the task is to design a cyclic iterator that prints the elements of these vectors in a cyclic manner. For example: v1… Read More »

Given an array arr[] of size N. The task is to find the maximum subarray sum possible after performing the given operation at most once.… Read More »

Given an array of size N containing numbers only from 0 to 63, and you are asked Q queries regarding it. Queries are as follows:… Read More »

Given an array Q[] of size N – 1 such that each Q[i] = P[i + 1] – P[i] where P[] is the premutation of… Read More »

Given an integer N and an array seats[] where N is the number of people standing in a line to buy a movie ticket and… Read More »

Given an array of integers, the task is to calculate the sum of GCD of all the subarrays of an array. GCD of an array… Read More »

Consider an array A[] of integers and the following two types of queries. update(l, r, x): multiply x to all values from A[l] to A[r]… Read More »

Given a K-increasing-decreasing array arr[], the task is to sort the given array. An array is said to be K-increasing-decreasing if elements repeatedly increase upto… Read More »

Given an array arr, the task is to find the length of Longest Increasing Sequence using Binary Indexed Tree (BIT) Examples: Input: arr = {6,… Read More »

Given a connected, directional graph. Each node is connected to exactly two other nodes. There is weight associated with each edge denoting the cost to… Read More »

Given an array arr[] of N positive integers, the task is to find the count of indices i such that all the elements from arr[0]… Read More »

Given a binary array arr[] of size N. The task is to find the minimum number of inversions required so that no two adjacent elements… Read More »

Given an array arr[] of size N which represents the initial number on each card and given a two dimensional array B[][] of size M… Read More »

Given an array arr[] of size N > 1. The task is to find the maximum possible GCD of the array by replacing at most… Read More »

Given an array arr[] of size N, the task is to find the maximum sum of the elements of the array after applying the given… Read More »