Skip to content

Category Archives: Dynamic Programming

Given a string S, the task is to count the maximum occurrence of subsequences in the given string such that the indices of the characters… Read More
Given an array arr[] of length N, the task is to maximize the sum of all the elements of the array by performing the following… Read More
Given two positive integers N and K, the task is to count the number of positive integers D such that D has N digits and… Read More
Given an integer N, the task is to find the Nth pure number.   A pure number has to satisfy three conditions: 1) It has an even… Read More
Given a string S, the task is to count the number of ways to partition the string into two non-empty parts such that both the… Read More
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