Skip to content

Tag Archives: prefix-sum

Given two arrays A[] and B[] consisting of N positive integers and an integer K, the task is to find the Kth smallest element in… Read More
Given an array arr[] consisting of N positive integers, the task is to find the prefix factorials of a prefix sum array of the given… Read More
Given two integers L and R and an array arr[] consisting of N positive integers( 1-based indexing ) such that the frequency of ith element… Read More
Given an array arr[] consisting of N integers and an array P[] consisting of M integers such that P[i] represents the score obtained by working… 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 a binary string S of size N, the task is to find the length of the longest non-increasing subsequence in the given string S.… Read More
Given an array arr[] consisting of N positive integers and an array Query[][2] consisting of Q queries of the form {L, R}, the task is… Read More
Given a circular array arr[] consisting of N integers, the task is to find the starting index of the circular array such that the prefix… Read More
Given an array arr[] consisting of N positive integers, the task is to make all array elements equal by repeatedly subtracting 1 from any number… Read More
Given an array arr[] consisting of N 0s (1-based indexing) and another array query[], with each row of the form {L, R}, the task for… Read More
Given an array arr[] consisting of N integers, the task is for each array element, say arr[i], is to find the number of array elements… Read More
Given an array arr[] consisting of N integers, the task is to replace a minimum number of pairs of adjacent elements by their sum to… Read More