## Fill the missing numbers in the array of N natural numbers such that arr[i] not equal to i

Given an unsorted array arr[] consisting of N natural numbers and the missing numbers as 0 such that arr[i] ≠ i, the task is to… Read More »

- Sum of all natural numbers from L to R ( for large values of L and R )
- Find the permutation of first N natural numbers such that sum of i % P
_{i}is maximum possible - Find permutation with maximum remainder Sum
- Count number of ways to arrange first N numbers
- Divide first N natural numbers into 3 equal sum subsets
- Repeated sum of first N natural numbers
- Difference between Sum of Cubes and Sum of First N Natural Numbers

Given an unsorted array arr[] consisting of N natural numbers and the missing numbers as 0 such that arr[i] ≠ i, the task is to… Read More »

Given an array arr[] of distinct integers from 1 to N. The task is to find the minimum number of swaps required to sort the… Read More »

Given a number N, the task is to count all possible combinations of pairs formed using adjacent elements. Note: If an element exists already in… Read More »

Given two numbers N and S, the task is to find the length of smallest subarray in range (1, N) such that the sum of… Read More »

Given a permutation P of first N natural numbers. The task is to find the number of i’s such that Pi ≤ Pj for all… Read More »

Given two integers N and K, the task is to find the count of set bits in the Kth number in the Odd-Even sequence made… Read More »

Given a permutation P of first N natural numbers. The task is to find the number of elements Pi such that Pi is second smallest… Read More »

Given a permutation {P1, P2, P3, ….. PN) of first N natural numbers. The task is to check if it is possible to make the… Read More »

Given a positive integer N > 1, the task is to find the maximum LCM among all the pairs (i, j) such that i <… Read More »

Count number of ways to arrange the first N natural numbers in a line such that the left-most number is always 1 and no two… Read More »

Given a number N. The task is to find the permutation P of first N natural numbers such that sum of i % Pi is… Read More »

Given two integers N and K, the task is to find the sum of first N natural numbers then update N as the previously calculated… Read More »

Given an integer N, find the absolute difference between sum of the cubes of first N natural numbers and the sum of first N natural… Read More »

Given an integer N, the task is to check whether the elements from the range [1, N] can be divided into three non-empty equal sum… Read More »

Given two very large numbers L and R where L ≤ R, the task is to compute the sum of all the natural numbers from… Read More »