Minimize subarray increments/decrements required to reduce all array elements to 0
Given an array arr[], select any subarray and apply any one of the below operations on each element of the subarray: Increment by one Decrement… Read More »
Given an array arr[], select any subarray and apply any one of the below operations on each element of the subarray: Increment by one Decrement… Read More »
Given a string str, the task is to find the substring of length K which occurs the maximum number of times. If more than one… Read More »
Given two integers X and Y, the task is to find the total number of ways to generate a pair of integers A and B… Read More »
Given two sorted arrays A[] and B[] consisting of N distinct integers, the task is to rearrange the elements of array B[] such that, for… Read More »
Given an array arr[] consisitng of N integers, the task is to make all array elements equal by selecting any pair of integers from the… Read More »
Given a matrix, mat[][] of size N * M, where N and M is always even, and two integers X and Y, the task is… Read More »
Given two integers N and K, the task is to maximize the sum of the Kth column of N * N row-wise sorted matrix consisting… Read More »
Given an array arr[] consisting of N integers, the task is to check if any permutation of the array elements exists where the sum of… Read More »
Given a string S, split the given string into as many substrings as possible such that each character from the given string appears in a… Read More »
Given string str of lowercase alphabets, split the given string into as many substrings as possible such that each character from the given string appears… Read More »
Given an integer N, the task is to check if the given number is a perfect square having all its digits as a perfect square… Read More »
Given an integer N, the task is to check if this number can be represented as the sum of two consecutive perfect cubes or not.… Read More »
Given a string S, the task is to print the count of substrings from a given string whose first and last characters are different. Examples:… Read More »
Given a string S of lowercase English alphabets, the task is to find the minimum number of characters to be changed such that the left… Read More »
Given a string S, the task is to print the string after removing the minimum size substring such that S is a palindrome or not.… Read More »