## Number of triplets in array having subarray xor equal

Given an array of integers Arr. The task is to count the number of triplets (i, j, k) such that Ai ^ Ai+1 ^ Ai+2… Read More »

## Number of Subarrays with positive product

Given an array arr[] of N integers, the task is to find the count of subarrays with positive product. Examples: Input: arr[] = {-1, 2,… Read More »

## Find subarray with given sum with negatives allowed in constant space

Given an unsorted array of integers, find a subarray which adds to a given number. If there are more than one subarrays with the sum… Read More »

## Find number of subarrays with XOR value a power of 2

Given an integer array, arr[] of size N. The XOR value of any subarray of arr[] is defined as the xor of all the integers… Read More »

## Number of sub arrays with negative product

Given an array arr[] of N integers, the task is to find the count of subarrays with negative product. Examples: Input: arr[] = {-1, 2,… Read More »

## Maximum subsequence sum such that all elements are K distance apart

Given an array arr[] of N integers and another integer K. The task is to find the maximum sum of a subsequence such that the… Read More »

## Maximum sum after K consecutive deletions

Given an array arr[] of size N and an integer K, the task is to delete K continuous elements from the array such that the… Read More »

## Count of triplets that satisfy the given equation

Given an array arr[] of N non-negative integers. The task is to count the number of triplets (i, j, k) where 0 ≤ i <… Read More »

## Count number of permutation of an Array having no SubArray of size two or more from original Array

Given an array of distinct integer A, the task is to count the number of possible permutations of the given array A[] such that the… Read More »

## Queries for number of distinct elements in a subarray | Set 2

Given an array arr[] of N integers and Q queries. Each query can be represented by two integers L and R. The task is to… Read More »

## Find all unique pairs of maximum and second maximum elements over all sub-arrays in O(NlogN)

Let represent the ordered pair of the second maximum and the maximum element of an array respectively. We need to find all such unique pairs… Read More »

## Find array such that no subarray has xor zero or Y

Given two integers X (1 ≤ X ≤ 15) and Y. The task is to find an array of the maximum possible length N such… Read More »

## Maximum length sub-array which satisfies the given conditions

Given a binary array arr[], the task is to find the length of the longest sub-array of the given array such that if the sub-array… Read More »

## Longest Subarray having strictly positive XOR

Given an array arr[] of N non-negative integers. The task is to find the length of the longest sub-array such that XOR of all the… Read More »

## Greatest contiguous sub-array of size K

Given an array arr[] of integers and an integer K, the task is to find the greatest contiguous sub-array of size K. Sub-array X is… Read More »