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 : …

#### Blog Posts

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, …

Consider a convex polygon with N vertices, with the additional property that no three diagonals intersect in a single point. Find the number of intersections between pairs of diagonals in such a …

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 …

A Fenwick tree or binary indexed tree is a data structure that was first used for data compression. It is often used for storing frequencies and manipulating cumulative frequency tables. …

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 …