Skip to content

Category Archives: Dynamic Programming

Given an N x M matrix of integers and an integer K, the task is to find the size of the maximum square sub-matrix (S… Read More
Given an array A containing N elements. Partition any subset of this array into two disjoint subsets such that both the subsets have an identical… Read More
Given two integers N and M, which denotes the position of in the coordinate system, the task is to count path from this point to… Read More
Given an integer N and set of digits D[], which consists of digits from [1, 9]. The task is to count the numbers possible less… Read More
Given a number K, the task is to print the fibonacci numbers present at Kth level of a Fibonacci Binary Tree.Examples:   Input: K = 3… Read More
Given two integers N and K, the task is to count the number of ways to divide N into K groups of positive integers such… Read More
Given an array of strings A, each of the same length and a target string S, find the number of ways to construct the target… Read More
Given an array arr of length N, the task is to minimize its length by performing following operations:   Remove any adjacent equal pairs, ( i.e.… Read More
Given an array A of size N, the task is to find the maximum score possible of this array. The score of an array is… Read More
Given a positive integer N, the task is to count all possible distinct binary strings of length N such that there are no consecutive 1’s.… Read More
Given a matrix A[][] of N * M, the task is to find the maximum sum from the top row to the bottom row after… Read More
Given a list of strings arr[] of zeros and ones only and two integer N and M, where N is the number of 1’s and… Read More
Given an array arr[] and a number K, the task is to make all elements of array divisible by K. To make elements divisible by… Read More
Given N stones in a row from left to right. From each stone, you can jump to at most K stones. The task is to… Read More
Given string str. The task is to count the number of all different strings possible if two consecutive same characters of the string can be… Read More