##
Find maximum possible stolen value from houses
June 27, 2017

There are n houses build in a line, each of which contains some value in it. A thief is going to steal the maximal value… Read More »

June 27, 2017

There are n houses build in a line, each of which contains some value in it. A thief is going to steal the maximal value… Read More »

Given an integer n > 0, which denotes the number of digits, the task to find total number of n-digit positive integers which are non-decreasing… Read More »

June 24, 2017

Given a fence with n posts and k colors, find out the number of ways of painting the fence such that at most 2 adjacent… Read More »

June 23, 2017

In this post, we will be using our knowledge of dynamic programming and Bitmasking technique to solve one of the famous NP-hard problem “Travelling Salesman… Read More »

June 22, 2017

Given an array, the task is to find to LIS (Longest Increasing Subsequence) in a circular way. Examples: Input : arr[] = {5, 4, 3,… Read More »

June 19, 2017

Given weights and values of n items and a value k. We need to choose a subset of these items in such a way that… Read More »

June 17, 2017

Given a height h, count and return the maximum number of balanced binary trees possible with height h. A balanced binary tree is one in… Read More »

June 14, 2017

We need to write N same characters on a screen and each time we can insert a character, delete the last character and copy and… Read More »

June 13, 2017

You are standing on a point (n, m) and you want to go to origin (0, 0) by taking steps either left or down i.e.… Read More »

June 12, 2017

We have N (where N > 2) stones of various heights laid out in a row. Task is to make a pyramid from given array… Read More »

June 10, 2017

Given a floor of size n x m and tiles of size 1 x m. The problem is to count the number of ways to… Read More »

June 8, 2017

Given a rectangular grid of dimension 2 x n. We need to find out the maximum sum such that no two chosen numbers are adjacent,… Read More »

June 6, 2017

Given a set of m distinct positive integers and a value ‘N’. The problem is to count the total number of ways we can form… Read More »

June 4, 2017

Given two integers m & n, find the number of possible sequences of length n such that each of the next element is greater than… Read More »

June 2, 2017

Given a string of digits “0-9”. The task is find the number of substrings which are divisible by 8 but not by 3. Examples: Input… Read More »