Given an array arr[] containing a random permutation of first N natural numbers, the task is to find the longest sub-sequence having the property that… Read More

# Tag Archives: limited-range-elements

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 ≤ Length of S… 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.Examples: … 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 the minimum number of elements of the array… 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