# Category Archives: Dynamic Programming

## Count number of ways to jump to reach endMay 20, 2017

Given an array of numbers where each element represents the max number of jumps that can be made forward from that element. For each array… Read More »

## Minimum number of deletions to make a sorted sequenceMay 18, 2017

Given an array of n integers. The task is to remove or delete minimum number of elements from the array so that when the remaining… Read More »

## Minimum steps to delete a string after repeated deletion of palindrome substrings

Given a string containing characters as integers only. We need to delete all character of this string in a minimum number of steps where in… Read More »

## Longest alternating subsequenceMay 13, 2017

A sequence {x1, x2, .. xn} is alternating sequence if its elements satisfy one of the following relations : x1 < x2 > x3 <… Read More »

## Clustering/Partitioning an array such that sum of square differences is minimum

Given an array of n numbers and a number k. We need to divide the array into k partitions (clusters) of same or different length.… Read More »

## Minimum steps to minimize n as per given conditionMay 12, 2017

Given a number n, count minimum steps to minimize it to 1 according to the following criteria: If n is divisible by 2 then we… Read More »

## Minimum number of deletions to make a string palindromeMay 10, 2017

Given a string of size ‘n’. The task is to remove or delete minimum number of characters from the string so that the resultant string… Read More »

## Count of arrays in which all adjacent elements are such that one of them divide the anotherMay 2, 2017

Given two positive integer n and n. The task is to find the number of arrays of size n that can be formed such that… Read More »

## Temple OfferingsApril 25, 2017

Consider a devotee wishing to give offerings to temples along a mountain range. The temples are located in a row at different heights. Each temple… Read More »

## Smallest length string with repeated replacement of two distinct adjacent

Given a string of any combination of three letters ‘a’, ‘b’, and ‘c’, find length of the smallest string that can be obtained by applying… Read More »

## Top 20 Dynamic Programming Interview QuestionsApril 22, 2017

Dynamic Programming is an algorithmic paradigm that solves a given complex problem by breaking it into subproblems and stores the results of subproblems to avoid… Read More »

## Digit DP | IntroductionApril 21, 2017

Prerequisite : How to solve a Dynamic Programming Problem ? There are many types of problems that ask to count the number of integers ‘x‘… Read More »

## Subset with sum divisible by mApril 16, 2017

Given a set of non-negative distinct integers, and a value m, determine if there is a subset of the given set with sum divisible by… Read More »

## Maximum sum of a path in a Right Number Triangle

Given a right triangle of numbers, find the largest of the sum of numbers that appear on the paths starting from the top towards the… Read More »

## Largest sum Zigzag sequence in a matrix

Given a matrix of size n x n, find sum of the Zigzag sequence with the largest sum. A zigzag sequence starts from the top… Read More »