Given a 2D matrix arr[] of size N*M, the task is to find the number of rows and columns having all primes. Examples: Input: arr[]=… Read More

# Tag Archives: sieve

Given a positive integer, A. The task is to find two numbers B and C such that their product is A and their GCD should… Read More

Given an array arr[] of size N. The task is to sort the elements in arr[] based to their Highest Degree of Expression, in descending… Read More

Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0

Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 Output: … Read More

Given an array arr[] consisting of N positive integers, the task is to check if the product of all the elements of the given array… Read More

Given a 2d array mat[][], the task is to find and print the prime numbers along with their position (1-based indexing) in this 2d array.… Read More

Given an array arr[] of length N with distinct integers from 1 to 2*N, the task is to count the number of pairs of indices… Read More

Given a number N, the task is to check if N can be represented as the product of a prime and a composite number or… Read More

Given a positive integer N, the task is to find the number of unordered pairs of semi-prime numbers in the range [1, N] such that… Read More

Given a positive integer N, the task is to find the largest number in the range [1, N] such that the square root of the… Read More

Given an array arr[] of size N. The task is to find the minimum number of swaps required to re-arrange the array such that all… Read More