# Category Archives: Mathematical

Given a 4-digit number with at least two distinct digits, Your program should perform the following operations on the number:  Arrange the digits in descending… Read More
Given an array A[] of size N, the task is to find the total number of positions in all the subarrays such that the value… Read More
Given a binary string S, the task is to count the substrings having the number of 0s and 1s in the ratio of X :… Read More
Given two arrays A[] and B[] of length N and M respectively and a prime number X, the task is to find the number of… Read More
Given an array A[] of size N, and an integer X, the following operation can be performed on that array: Choose any element, say Y… Read More
The XOR operation between two numbers P and Q can be looked in a different way as the bitwise sum modulo 2 on the bits… Read More
Given a positive integer N, the task is to tell whether it’s an anti-prime number or not. Anti-Prime Numbers (Highly Composite Number): A positive integer… Read More
Given a binary string S of size N and an integer K, the task is to divide S into K disjoint subsequences(empty subsequences are also… Read More
Given an array A[] of size N where each element A[i] =max(P, P, . . ., P[i]), where P[] is a permutation consisting of elements… Read More
Given an array A[] of the length N. The task is to find the minimum sum of the array (i.e. A1 + A2 + …… Read More
Given a strictly increasing array A[] of size N, an integer K and Q queries of type [L, R], the task is to count the… Read More
Given an array of pairs arr[] of size N (N ≥ 3) where each element of pair is at most N and each pair is… Read More
Given positive integers N, A, B and C such that 1 ≤ C < N. The task is to maximize the value of B by… Read More
Why do we check up to the square root of a number to determine if that number is prime? Prime numbers are natural numbers greater… Read More
Given an integer N which denotes the number of elements in a binary heap. Check if the binary Heap is completely filled or not. Examples:… Read More