Tutorials
Courses
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Misc
7.8K+ articles
Arrays
4.2K+ articles
Sorting
1.1K+ articles
Searching
1.0K+ articles
Hash
830+ articles
Bit Magic
821+ articles
Bitwise-XOR
443+ articles
graph-cycle
58+ articles
limited-range-elements
29 posts
Recent Articles
Popular Articles
Minimum moves required to change position with the given operation
Last Updated: 02 June 2021
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 the minimum number of moves to move Sth element to ...
read more
DSA
limited-range-elements
Generate a sequence with the given operations
Last Updated: 07 December 2022
Given a stringSwhich contains onlyI(increase) andD(decrease). The task is to return any permutation of integers [0, 1, ..., N] where N ? Length of S such that for all i = ...
read more
Strings
DSA
limited-range-elements
programming-puzzle
Maximum number of fixed points using atmost 1 swap
Last Updated: 06 September 2022
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 as the index (That is, a[i]=i). You are allowed to...
read more
DSA
Arrays
array-rearrange
limited-range-elements
Queries for number of elements on right and left
Last Updated: 06 February 2023
Given Q queries of three types where every query consists of a number.Add element num on the leftAdd element num on the rightPrint the number of elements to the right an l...
read more
DSA
limited-range-elements
Constructive Algorithms
Kth Smallest sum of continuous subarrays of positive numbers
Last Updated: 31 March 2023
Given an sorted array of positive numbers our tasks is to find the kth smallest sum of continuous subarray. Examples:Input : a[] = {1, 2, 3, 4, 5, 6} k = 4Output : 3 Expla...
read more
Technical Scripter 2018
DSA
Binary Search
prefix-sum
limited-range-elements
Minimum array element changes to make its elements 1 to N
Last Updated: 08 September 2022
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 which must be changed so that array ha...
read more
Misc
Hash
DSA
Arrays
limited-range-elements
cpp-unordered_map
Longest chain of arr[i], arr[arr[i]], .. without repetition
Last Updated: 30 August 2022
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 length of the longest chain {arr[i], arr[arr[i]], arr[arr...
read more
Misc
DSA
Arrays
limited-range-elements
graph-cycle
Minimum number of adjacent swaps for arranging similar elements together
Last Updated: 26 August 2022
Given an array of 2 * N positive integers where each array element lies between 1 to N and appears exactly twice in the array. The task is to find the minimum number of ad...
read more
DSA
array-rearrange
limited-range-elements
Duplicates in an array in O(n) time and by using O(1) extra space | Set-3
Last Updated: 11 July 2025
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 repeating numbers in O(n) and using...
read more
Searching
DSA
Arrays
limited-range-elements
Sorting array with conditional swapping
Last Updated: 17 August 2022
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. Each character of the string...
read more
Misc
Strings
DSA
Arrays
binary-string
limited-range-elements
Sort an array which contain 1 to n values
Last Updated: 11 July 2025
We are given an array that contains 1 to n elements, our task is to sort this array in an efficient way. We are not allowed to simply copy the numbers from 1 to n.Examples...
read more
Misc
Sorting
DSA
Arrays
limited-range-elements
Sort an array containing two types of elements
Last Updated: 16 November 2024
This problem appears in multiple forms as mentioned below. If we take a closer look at the below problems, we can notice that the problem is mainly a variation of partitio...
read more
DSA
limited-range-elements
Only Repeating From 1 To n-1
Last Updated: 19 April 2025
Given an array arr[] of size n filled with numbers from 1 to n-1 in random order. The array has only one repetitive element. The task is to find the repetitive element.Exa...
read more
Searching
Hash
DSA
Arrays
Bitwise-XOR
limited-range-elements
cpp-unordered_set
Check if the array is beautiful
Last Updated: 03 May 2024
Given an integer n and an array of size n check if it satisfies following conditions:-All elements of array must lie between 1 to n.Array must NOT be sorted in ascending o...
read more
Misc
DSA
Arrays
limited-range-elements
Find the one missing number in range
Last Updated: 28 October 2022
Given an array of size n. It is also given that range of numbers is from smallestNumber to smallestNumber + n where smallestNumber is the smallest number in array. The arr...
read more
Misc
Searching
DSA
Arrays
Bitwise-XOR
limited-range-elements
1
2
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !