Check if a large number can be divided into two or more segments of equal sum

Given a very large Number N. The task is to check if the number can be divided into two or more segments of an equal… Read More »

Maximum occurred integer in n ranges | Set-2

Given N ranges of L-R. The task is to print the number which occurs the maximum number of times in the given ranges. Note: 1… Read More »

Check if every index i has an index j such that sum of elements in both directions are equal

Given a circular array of size N. The task is to check if, for every index i starting from 0 to N-1, there exists an… Read More »

Check if a line at 45 degree can divide the plane into two equal weight parts

Given a set of n points (xi, yi) in 2D coordinate. Each point has some weight wi. The task is to check whether a line… Read More »

Replace every element of the array by sum of all other elements

Given an array of size N, the task is to find the encrypted array. The encrypted array is obtained by replacing each element of the… Read More »

Longest subarray having average greater than or equal to x | Set-2

Given an array of N integers. The task is to find the longest contiguous subarray so that the average of its elements is greater than… Read More »

Subarray whose absolute sum is closest to K

Given an array of n elements and an integer K, the task is to find the subarray with minimum value of ||a[i] + a[i +… Read More »

Split array to three subarrays such that sum of first and third subarray is equal and maximum

Given an array of N integers, the task is to print the sum of the first subarray by splitting the array into exactly three subarrays… Read More »

First element greater than or equal to X in prefix sum of N numbers using Binary Lifting

Given an array of N integers and a number X. The task is to find the index of first element which is greater than or… Read More »

Largest subarray having sum greater than k

Given an array of integers and a value k, find length of largest subarray having sum greater than k. Examples: Input : arr[] = {-2,… Read More »

Longest substring with count of 1s more than 0s

Given a binary string find the longest substring which contains 1’s more than 0’s. Examples: Input : 1010 Output : 3 Substring 101 has 1… Read More »

Sum of all prime divisors of all the numbers in range L-R

Given two integers L and R. The task is to find the sum of all prime factors of every number in the range[L-R]. Examples: Input:… Read More »

Sudo Placement[1.5] | Partition

Given an array of positive and negative numbers. The task is to find a partition point such that none of the elements of left array… Read More »

Minimum positive integer required to split the array equally

Given an array of N positive integers, the task is to find the smallest positive integer that can be placed between any two elements of… Read More »

Queries for number of array elements in a range with Kth Bit Set

Given an array of N positive (32-bit)integers, the task is to answer Q queries of the following form: Query(L, R, K): Print the number of… Read More »