Skip to content

Tag Archives: Natural Numbers

Given a positive integer N, the task is to print all the numbers, say K, such that K is a divisor of N and K… Read More
Given an array arr[] of size N, the task is to find the lexicographically smallest permutation of first 2*N natural numbers such that every ith… Read More
Given a positive integer N, the task is to construct a permutation of first N natural numbers such that the absolute difference between adjacent elements… Read More
Given an array arr[] consisting of (N – 1), the task is to construct a permutation array P[] consisting of the first N Natural Numbers… Read More
Given an array A[] of size N, the task is to find the minimum sum of numbers required to be added to array elements to… Read More
Given an array p[] of size N representing a permutation of first N natural numbers, where N is an even number, the task is to… Read More
Given a positive integer N, the task is to calculate the Bitwise XOR of first N numbers which are a product of exactly two distinct… Read More
Given a positive integer N, the task is to find a permutation of length N having Bitwise OR of any of its subarray greater than… Read More
Given an array, arr[] of size N denoting a permutation of numbers from 1 to N, the task is to count the number of inversions… Read More
Given two positive integers N and K, the task is to construct a permutation of the first N natural numbers such that all possible absolute… Read More
Given a positive integer N, the task is to find the largest positive number made up of distinct digits having the sum of its digits… Read More
Given two numbers N and M, the task is to find the number of sorted arrays that can be formed of size M using first… Read More
Given an array A[] of size N, containing a permutation of first N natural numbers and an integer K, the task is to find the… Read More
Given two positive integers, N and K ( 1 ≤ K ≤ N ), the task is to construct an array arr[](1-based indexing) such that… Read More
Given three positive integers S, K, and N, the task is to find K distinct positive integers, not exceeding N and having sum equal to… Read More