Skip to content

Category Archives: Arrays

Given an array arr[] of size N. The task is to find the maximum score that can be achieved by alternative minus – plus of… Read More
Given two positive integers N and K, the task is to construct a permutation of the first N natural numbers such that all possible absolute… Read More
Given an array arr[] of N integers and M update queries of the type (L, R, X), the task is to find the maximum subarray… 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 two integers N and K, the task is to find the count of sequences of K elements from the range [1, N] where every… Read More
Given an array arr[] of size N and two integers X and K, the task is to find the maximum score that can be achieved… Read More
Given an array arr[], the task is to check if it is possible to sort the given array using any number of operations where at… Read More
Given an array arr[] of length N and an integer X, the task is to find the number of subsets with a sum equal to… Read More
Given an array arr[] of positive integers of size N, and an integer K. The task is to minimize the number of operations required choose… Read More
Given an array arr[], the task is to minimize the sum of minimum and second minimum elements from all possible triplets. One element can be… Read More
Given numeric string str, the task is to find the minimum operations needed to make the string palindrome. An operation is defined as:  Select one… Read More
Given an array arr[] of length N, the task is to find the minimum product of subarray of size K of an array including negative… Read More
Given a binary string str[] of size N. The task is to find the longest balanced substring. A substring is balanced if it contains an… Read More
Given an array arr[] of N integers, find the length of the longest subarray having sum in the range [L, R]. Examples:  Attention reader! Don’t… Read More
Given an array arr[] containing N strings, the task is to find the count of strings which are isograms. A string is an isogram if… Read More