Given a string str of lowercase English alphabets, the task is to check whether the string is a vowel prime or not. A string is… Read More

# Tag Archives: sieve

Given an integer N, the task is to find the sum of semi-prime numbers which are less than or equal to N. A Semi prime… Read More

Given a string str of size N. The task is to find out whether it is possible to rearrange characters in string str so that… Read More

Given an integer N, for every integer i in the range 2 to N, assign a positive integer such that the following conditions hold : For… Read More

Given Q queries where each query consists of two positive integers L and R and the task is to find the absolute difference between the… Read More

Given an array of numbers and the value of , check if each number can be expressed as the product of exactly prime numbers. For every element of the… Read More

Given an array arr[] of N integers, the task is to count the number of primes in the prefix sum array of the given array. Examples: … Read More

Given an array arr[] of n integers. The task is to find an element from the array K such that K is prime. And, arr[i]… Read More

Given a number N, the task is to find the largest number less than or equal to the given number N such that on rearranging… Read More

Given an integer N, the task is to check if N is a Dihedral prime number or not. A Dihedral prime is a prime number… Read More

Given an array arr[] of integers of size n. For each element, you have to print the summation of multiplication of every triplet formed using… Read More

Given two arrays arr1[] and arr2[]. The task is to count the distinct sums that can be obtained while choosing a prime element from arr1[]… Read More

Given an integer N, the task is to find the sum of all Truncatable primes below N. Truncatable prime is a number which is left-truncatable… Read More

Given a range [l, r], the task is to find the sum of all the even factors of the numbers from the given range.Examples: Input:… Read More