Given an array arr[] consisting of values (0, 1, 2, 3) of length N, representing the type of work that can be done on any… Read More
Category Archives: Dynamic Programming
Given a string S of size N and an array queries, containing Q queries in the form of L, R. The task is to find… Read More
Given two arrays array[] and multipliers[] of size N and M where N is always greater than equal to M. There are M operations to… Read More
Given a binary array arr[] and a value array val[]. The task is to find the maximum possible splits of the binary array that can… Read More
Given two integers N and M, the task is to calculate the minimum number of moves to change N to M, where In one move… Read More
Given an array arr[] of size N, the task is to find the minimum number of operations required to make all the array elements equal… Read More
Given an array arr[] having N integers, the task is to find the next greater number X i.e, X >= arr[i] for each i in… Read More
Given an array arr[], the task is to calculate the maximum sum of elements from the array such that, if an ith element is picked,… Read More
Given an array arr[] consisting of N positive integers, the task is to find the maximum value of the difference between the sum of elements… Read More
Given binary string str, consisting of only two characters ‘1‘ and ‘0‘, and an integer X, the task is to calculate the minimum cost to… Read More
Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write… Read More
Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write… Read More
Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write… Read More
Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write… Read More