# Tag Archives: math

## Check if array can be divided into two sub-arrays such that their absolute difference is K

Given an array arr[] and an integer K, the task is to find whether the array can be divided into two sub-arrays such that the… Read More »

## Find the repeating and the missing number using two equations

Given an array arr[] of size N, each integer from the range [1, N] appears exactly once except A which appears twice and B which… Read More »

## Sum of all even numbers in range L and R

Given two integers L and R, the task is to find the sum of all even numbers in range L and R. Examples: Input: L… Read More »

## Check if N can be represented as sum of integers chosen from set {A, B}

Given three integers N, A and B, the task is to find whether N can be represented as sum of A’s and B’s. Examples: Input:… Read More »

## Number of pairs with Bitwise OR as Odd number

Given an array A[] of size N. The task is to find the how many pair(i, j) exists such that A[i] OR A[j] is odd.… Read More »

## Partition N into M parts such that difference between Max and Min part is smallest

Given two integers N and M, partition N into M integers such that the difference between the maximum and minimum integer obtained by the partition… Read More »

## Count pairs with Bitwise-AND as even number

Given an array of integers. The task is to find the number of pairs (i, j) such that A[i] & A[j] is even. Examples: Input:… Read More »

## Split N^2 numbers into N groups of equal sum

Given an even number N. The task is to consider numbers from 1 to N2, split them into N groups of the equal sum. Examples:… Read More »

## Count pieces of circle after N cuts

Given an integer N, where . The task is to print the count of pieces of a circle with N cuts where each cut passes… Read More »

## Count subarrays consisting of only 0’s and only 1’s in a binary array

Given a binary array consisting of only zeroes and ones. The task is to find: The number of subarrays which has only 1 in it.… Read More »

## Number of words in a camelcase sequence

CamelCase is the sequence of one or more than one words having the following properties: It is a concatenation of one or more words consisting… Read More »

## Reconstruct the array by replacing arr[i] with (arr[i-1]+1) % M

Given an array of N elements and an integer M. Now, the array is modified by replacing some of the array elements with -1. The… Read More »

## Represent a number as a sum of maximum possible number of Prime Numbers

Given a positive integer . The task is to represent it as a sum of the maximum possible number of prime numbers. (N > 1)… Read More »

## Maximize number of nodes which are not part of any edge in a Graph

Given a graph with n nodes and m edges. Find the maximum possible number of nodes which are not part of any edge (m will… Read More »

## Number of solutions for x < y, where a <= x <= b and c <= y <= d and x, y are integers

Given four integers a, b, c, d ( upto 10^6 ). The task is to Find the number of solutions for x < y, where… Read More »