Coin change is a classical dynamic programming problem to count the number of possible ways to get value V cents using list of denomination of n coins. For example : …

# Category: Algorithms

Trainsorting problem appears in uva online judge in which we need to find the longest train length. It can be solved using dynamic programming paradigm. Uva 11456 – Trainsorting Erin …

Here we will list down dynamic programming problems from major online judges. Longest Increasing Subsequence (LIS) UVa 00481 – What Goes Up?

Arrange the cards in groups so that all the cards in a group are of the same color. Next, sort the cards in each group by their value. Calculate the …

Today we are going to discuss longest increasing subsequence of an array using efficient algorithm with O(nlogn) complexity. As we all know lis can also be solved by dynamic programming …

There is a club with N members.This is a very prestigious club, its members are very rich and therefore extraordinary people, so they often extremely hate each other. Strictly speaking, …

Given a value N , if we want to build a wall of size 4xN and we have an infinite supply of bricks of size 1×4 and 4×1 , In …

Given an array A having n integers. We need to give an algorithm to find a contiguous subseqnence (A[i], A[i+1], …, A[j]) such that the sum of the elements in …

A sequence of numbers is called a zig-zag sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either …

Given an array of size n and k, how do you find the maximum for every contiguous subarray of size k? For example arr[n] = 1 -2 5 6 0 …