## Minimum moves required to change position with the given operation

Given two integers S and T and an array arr that contains elements from 1 to N in unsorted fashion. The task is to find… Read More »

- Find the Missing Number in a sorted array
- Duplicates in an array in O(n) time and by using O(1) extra space | Set-3
- Kth Smallest sum of continuous subarrays of positive numbers
- Queries for number of elements on right and left
- Minimum number of adjacent swaps for arranging similar elements together
- kth smallest/largest in a small range unsorted array
- Quotient - Remainder Sort
- Maximum number of fixed points using atmost 1 swap
- Minimum moves required to change position with the given operation
- Minimum array element changes to make its elements 1 to N
- Generate a sequence with the given operations
- Longest chain of arr[i], arr[arr[i]], .. without repetition

Given two integers S and T and an array arr that contains elements from 1 to N in unsorted fashion. The task is to find… Read More »

Given a string which contains only (increase) and (decrease). The task is to return any permutation of integers [0, 1, …, N] where N ≤… Read More »

Find kth smallest or largest element in an unsorted array, where k<=size of array. It is given that elements of array are in small range.… Read More »

Given a permutation of N elements (Elements are in range 0 to N-1). A fixed point is an index at which the value is same… Read More »

Given Q queries of three types where every query consists of a number. Add element num on the left Add element num on the right… Read More »

Quotient – Remainder Sort is a non-comparison based sorting algorithm. Steps to perform Quotient – Remainder sort as described below : Find MIN and MAX… Read More »

Given an sorted array of positive numbers our tasks is to find the kth smallest sum of continuous subarray. Examples: Input : a[] = {1,… Read More »

Suppose you are given an array with N elements with any integer values. You need to find minimum number of elements of the array which… Read More »

Given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in list. One of… Read More »

Given an array of size n such that elements in array are distinct and in range from 0 to n-1. We need to find out… Read More »

Given an array of 2 * N positive integers where each array element lies between 1 to N and appears exactly twice in the array.… Read More »

Given an array of n elements which contains elements from 0 to n-1, with any of these numbers appearing any number of times. Find these… Read More »

Given an array arr containing elements from [1…to n]. Each element appears exactly once in the array arr. Given an string str of length n-1.… Read More »

You have given an array which contain 1 to n element, your task is to sort this array in an efficient way and without replace… Read More »

Given a constant array of n elements which contains elements from 0 to n-1, with any of these numbers appearing any number of times. Find… Read More »