Given an array A[] containing N positive integers, the task is to find the largest possible number K, such that after replacing all elements by… Read More

# Category Archives: Mathematical

Given a positive integer N, the task is to check whether the given number N can be represented as the sum of the distinct powers… Read More

Given an array arr[] of size N, and an array Q[] consisting of M queries of type {L, R}, the task is to print the… Read More

Given three integers L, R, and K, the task is to find the minimum Bitwise XOR of at most K integers between [L, R]. Examples:… Read More

Given N candies, M people, and an array arr[] of M positive integers, the task is to find the minimum value of K such that… Read More

Given a string S, the task is to find the string which is lexicographically smallest and not a subsequence of the given string S. Examples: Input:… Read More

Given an array arr[] consisting of N integers such that each array element arr[i] represent coefficients of a polynomial expression starting with the highest degree(A[0].X(N… Read More

Given an array arr[] of size N, the task is to find the lexicographically smallest permutation of first 2*N natural numbers such that every ith… Read More

Given two numbers X and Y, the task is to make both of them equal by repeatedly multiplying with their prime factors minimum number of… Read More

Given a binary string S consisting of N characters, the task is to print the minimum number of operations required to remove all the characters… Read More

Given a number N, the task is to check if for every value of i (0 <= i <= len), the first i digits of… Read More

Given a numeric string S, the task is to find the number of ways to partition a string into substrings consisting of digits in increasing… Read More

Given an array A[] of size N, the task is to find the maximum sum of a subsequence such that for each pair present in… Read More

Given a positive integer N, the task is to construct a permutation of first N natural numbers such that the absolute difference between adjacent elements… Read More

Given an integer K and an array arr[] consisting of N integers, where an array element arr[i] represents the price of the ith book. Profit… Read More