Category Archives: Mathematical

Given a string str of length N, the task is to find the minimum number of substrings required to be removed to make all the… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to check if the sum of the array can be… Read More
Given an array arr[] and an integer K, the task is to find the array element from indices not divisible by K whose product of… Read More
Given an array arr[] of size N consisting of only of 0s initially, the task is to count the number of 1s that can be… Read More
Given an array arr[] of size N, the task is to find the maximum sum non-empty subsequence present in the given array. Examples: Input: arr[]… Read More
Given two arrays arr[] and brr[] consisting of N and K elements respectively, the task is to find the maximum subarray sum possible from the… Read More
Given an array arr[] of length N consisting of positive integers, the task is to find the longest increasing subsequence that can be formed by… Read More
Given a binary string S of length N consisting of 0s, 1s, and “?”, where “?” can be replaced by either 0 or 1, the… Read More
Given a 2D matrix mat[][] of size N * M, the task is to find the median of Bitwise XOR of all possible submatrices from… Read More
Given an array arr[] of size N, the task is to find the sum of the floor value of (arr[i] / arr[j]) for all pairs… Read More
Given an integer N, the task is to find the value of the expression ( N1 * (N – 1)2 * … * 1N) %… Read More
Given an array A[] consisting of N integers, the task is to find the minimum difference between the largest and the smallest element in the… Read More
Given two integers N and K, the task is to find the count of numbers up to N having K-th bit set. Examples: Input: N… Read More
Given an integer N, the task is to count the triplets (a, b, c) from the first N natural numbers such that a * b… Read More