## Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors

Given an integer N. The task is to find the number of integers 1 < x < N, for which x and x + 1… Read More »

- Count the number of vowels occurring in all the substrings of given string
- Find the sums for which an array can be divided into sub-arrays of equal sum
- Minimum value to add to arr[i] so that an array can be split at index i with equal sum
- Partition the array into three equal sum segments
- Two equal sum segment range queries
- Maximum sum subarray such that start and end values are same
- Index with Minimum sum of prefix and suffix sums in an Array
- Product of all primes in the range from L to R
- Find the number of sub arrays in the permutation of first N natural numbers such that their median is M
- Partition an array such into maximum increasing segments
- Number of subarrays having sum of the form k^m, m >= 0
- Count the number of sub-arrays such that the average of elements present in the sub-array is greater than that not present in the sub-array
- Sum of first N natural numbers by taking powers of 2 as negative number
- Find the value of max(f(x)) - min(f(x)) for a given F(x)
- Sum of all odd factors of numbers in the range [l, r]
- Sum of all even factors of numbers in the range [l, r]
- Minimum elements to change so that for an index i all elements on the left are -ve and all elements on the right are +ve
- Count number of indices such that s[i] = s[i+1] : Range queries
- Replace all elements by difference of sums of positive and negative numbers after that element
- Queries to answer the number of ones and zero to the left of given index
- Check whether two strings can be made equal by increasing prefixes
- Maximum sub-array sum after dividing array into sub-arrays based on the given queries
- Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors

Given an integer N. The task is to find the number of integers 1 < x < N, for which x and x + 1… Read More »

Given an array of integers arr[], the task is to count the number of sub-arrays such that the average of elements present in the sub-array… Read More »

Given an array arr[] containing the permutation of first N natural numbers and an integer M ≤ N. The task is to find the number… Read More »

Given a binary array and Q queries. Every query consists of a number K, the task is to print the number of ones and zeros… Read More »

Given an array arr[] of integers, the task is to find the minimum non-negative integer k such that there exists an index jin the given… Read More »

Given an integer k and an array arr[], the task is to count the number of sub-arrays which have the sum equal to some positive… Read More »

Given an array of n integers, we have to partition the array into three segments such that all the segments have equal sum. Segment sum… Read More »

Given an array of positive and negative elements. The task is to replace every i-th element of the array by the absolute difference of absolute… Read More »

Given a range [l, r], the task is to find the sum of all the even factors of the numbers from the given range. Examples:… Read More »

Given a range [l, r], the task is to find the sum of all the odd factors of the numbers from the given range. Examples:… Read More »

Given an array arr[] consisting of N positive integers, and some queries consisting of a range [L, R], the task is to find whether the… Read More »

Given an array arr[] and an integer k, we can cut this array at k different positions where k[] stores the positions of all the… Read More »

Given an array of integers arr[], the task is to find all the values for sum such that for a value sum[i] the array can… Read More »

Given an array arr of size n, the task is to find the minimum number of elements that should be changed (element value can be… Read More »

Given an array of N positive numbers, the task is to find a contiguous subarray (L-R) such that a[L]=a[R] and sum of a[L] + a[L+1]… Read More »