Skip to content

Tag Archives: sieve

Given an integer N, the task is to count the number of prime factors of N!. Examples: Input: N = 5Output: 3Explanation: Factorial of 5… Read More
Given a matrix M[][] of dimension N*N, the task is to check if all the elements on the principal and cross diagonals of the matrix… Read More
Given an array arr[] of length N, with values less than N, the task is to construct another array A[] of same length such that… Read More
Given an array arr[] of size N, the task is to find the number of non-empty subsets present in the array such that every element(… Read More
Given an array arr[] of size N, the task is to find the count of distinct prime factors of each element of the given array.… Read More
Given an array arr[] consisting of N positive integers and an integer K, the task is to find the maximum sum of array elements in… Read More
Given an array arr[] of size N, the task is to find the maximum sum possible of the count of distinct prime factors of K… Read More
Given an integer N, the task is to find the number of distinct prime triplets from the range [1, N] having the sum of the… Read More
Given two integers L and R, the task is to calculate the count of numbers from the range [L, R] having exactly 5 distinct positive… Read More
Given an array arr[] consisting of N positive integers, the task is to find the sum of factors of product of all array elements. Since… Read More
Given two positive integers N and X, the task is to find the smallest divisor of N which is closest to X. Examples: Input: N… Read More
Given an array arr[] consisting of N positive integers and integers L and R, the task is to find the count of numbers in the… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to count the number of array elements having exactly K… Read More
Given string str of length N, the task is to remove all the characters from the string whose frequencies are prime. Examples: Input: str =… Read More
Given an array arr[] consisting of N non-negative integers, the task is to count the number of array elements whose product of digits is a… Read More