##
Array element moved by k using single moves
November 14, 2017

Given a list of n integers containing numbers 1-n in a shuffled way and a integer K. N people are standing in a queue to… Read More »

November 14, 2017

Given a list of n integers containing numbers 1-n in a shuffled way and a integer K. N people are standing in a queue to… Read More »

Given a set of n integers, perform minimum number of operations (you can insert/delete elements into/from the set) to make the MEX of the set… Read More »

You are given an array of n distinct integers. Your task is to divide this array into three non-empty sets so as the following conditions… Read More »

November 13, 2017

Given an even size array of integers. We need to find if it is possible to divide array elements into two sets such that following… Read More »

Given an array A[] of size N. Solve Q queries. Find the product in range [L, R] under modulo P ( P is Prime). Examples:… Read More »

Given a ternary array (every element has one the three possible values 1, 2 and 3). Our task is to replace the minimum number of… Read More »

Given an array and an integer K. We need to find the maximum of every segment of length K which has no duplicates in that… Read More »

November 12, 2017

Define a function int max(int a[], int n) which returns the largest integer from an integer array consisting of n elements (without using conditionals /… Read More »

November 10, 2017

Given an array of n positive integers. We need to find the largest increasing sequence of consecutive positive integers. Examples: Input : arr[] = {5,… Read More »

Given an array, find the length of the longest increasing subarray (contiguous elements) such that it is possible to change at most one number (change… Read More »

There is an array contains some non-negative integers. Check whether the array is perfect or not. An array is called perfect if it is first… Read More »

November 9, 2017

Given two numbers n and k, find an array containing values in [1, n] and requires exactly k calls of recursive merge sort function. Examples:… Read More »

Given a binary array and an integer k where every 1 has power and it can lend power to neighbors and itself. A cell with… Read More »

November 8, 2017

Given an array of N integers. In the given, for each positive element ‘x’ there exist a negative value ‘-x’, except one integer whose negative… Read More »

Prerequisite : Arrays in Python, Loops, List Comprehension Program to compute the sum of two matrices and then print it in Python. We can perform… Read More »