Skip to content

Tag Archives: sieve

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
Given two integers L and R, the task is to count the number of pairs from the range [L, R] whose sum is a prime… Read More
Given an integer N, the task is to count the number of pairs of prime numbers in the range [1, N] such that the difference… Read More
Given an array arr[] of size N, the task is to find the composite Fibonacci numbers present in the given array. Examples: Input: arr[] =… Read More
Given two integers L, R, and an integer K, the task is to print all the pairs of Prime Numbers from the given range whose… Read More
Given a 2D array Q[][] of size N * 2 representing queries of the form {L, R}. For each query, the task is to print… Read More
Given two integers L and R, the task is to count all the numbers in the range [L, R] whose sum of digits is a… Read More
Given an array arr[] of size N, the task is to find the maximum sum of a subsequence formed by concatenating disjoint subarrays whose lengths… Read More
Given an array arr[] consisting of non-negative integers, the task is to print the length of the longest subsequence from the given array whose sum… Read More
Given an integer N, the task is to find the number of ways N! can be split into two distinct factors A and B such… Read More
Given an array, arr[] of size N, the task is to count all the pairs of the given array whose product is a composite number.… Read More
Given an array arr[] of N positive integers and an integer K, the task is to find the maximum distinct prime factors in a subarray… Read More
Given an array, arr[] of size N, the task is to find the length of the longest increasing prime subsequence possible by performing the following… Read More
Given an array, arr[] of size N and an integer K, the task is to print a subarray of size K whose sum of elements… Read More
Given an array arr[] consisting of N positive integers, the task is to find the length of the longest increasing subsequence consisting of Prime Numbers… Read More