Skip to content

Category Archives: Dynamic Programming

Given an array arr[] of N integers along with integers M, L, R. Consider a variable S(initially 0). The task is to find the maximum… Read More
Given an integer N which denotes the size of a matrix, the task is to find the number of possible ways to reach the bottom-right… Read More
Given two arrays A[] and B[], the task is to find the maximum number of uncrossed lines between the elements of the two given arrays.… Read More
Given an integer N, the task is to find the minimum number of operations needed to obtain the number N starting from 1. Below are… Read More
Given an array A[] consisting of N positive integers and an integer K, the task is to find the length of the smallest subarray with… Read More
Content Removed For similar problem visit: Partition a set into two subsets such that the difference of subset sums is minimum Recommended Solve DSA problems… Read More
Given an array arr[] consisting of N integers, the task is to print the length of the longest subarray with a positive product. Examples: Input:… Read More
Given two integers N and M where M and N denote a matrix of dimensions N * M consisting of 0‘s only. The task is… Read More
Grammar denotes the syntactical rules for conversation in natural language. But in the theory of formal language, grammar is defined as a set of rules… Read More
Given two integers N and T denoting the number of levels and the number of seconds respectively, the task is to find the number of… Read More
Given an array arr[] of N integers, the task is to find the maximum sum of the array that can be obtained by flipping signs… Read More
Given two integers M and N, the task is to find the minimum cost to convert M to N by repetitive addition of even divisors… Read More
Given an integer N, the task is to check if N can be expressed as a sum of integers having 9 as the last digit… Read More
Given an array arr[] having N integers. The task is to determine if the array can be partitioned into 3 subsequences of an equal sum… Read More
Given a 2D matrix mat[][] of size N*M and Q queries of the form {x1, y1, x2, y2, K}. For each query, the task is… Read More

Start Your Coding Journey Now!