# Tag Archives: suffix-sum

Given an array (arr[]) of N integers, find a subsequence of 4 elements such that a[i] < a[j] < a[k] < a[l] and i <… Read More
Suffix Sum ArrayGiven an array arr[] of size N, the task is to compute and return its suffix sum array.  Suffix Sum is a precomputation… Read More
Given an array arr[] consisting of N positive integers, the task is to find the suffix factorials of a suffix sum array of the given… Read More
Given an array arr[], of size N and an integer S, the task is to find the minimum operations to make the sum of the… Read More
Given an array arr[] of integers of size N, the task is to maximize the sum of the array after removing valleys from the array… Read More
Given an array arr[] of integers, the task is to find the number of indices up to which prefix sum and suffix sum are equal.… Read More
Given an array, arr[] and a positive integer K. The task is to find the position say i of the element in arr[] such that… Read More
Given an array arr[] of size N, the task is to find the index in the given array where the sum of the prime numbers… Read More
Given an array arr[] consisting of N positive integers, the task is to find an index from the array having count of prime numbers present… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the sum of the length of the two… Read More
Given an array arr[] of length N, the task is to find the count of pairs of indices (i, j) (0-based indexing) such that prefix… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the number of times the absolute difference between… Read More
Given an array arr[] consisting of N integers, the task is to count ways to split array into two subarrays of equal sum by changing… Read More
Given an array arr[] consisting of N integers, the task is to count the number of ways to split the array into two subarrays of… Read More
Given an array arr[] consisting of non-negative integers, the task is to find the number of ways to split the array into three non-empty contiguous… Read More