##
Coin game winner where every player has three choices
August 26, 2017

A and B are playing a game. At the beginning there are n coins. Given two more numbers x and y. In each move a… Read More »

August 26, 2017

A and B are playing a game. At the beginning there are n coins. Given two more numbers x and y. In each move a… Read More »

August 24, 2017

Compute the shortest string for a combination of two given strings such that the new string consist of both the strings as its subsequences. Examples… Read More »

August 20, 2017

There are N players which are playing a tournament. We need to find the maximum number of games the winner can play. In this tournament,… Read More »

August 17, 2017

Given an array of non-negative integers and a value sum, determine if there is a subset of the given set with sum equal to given… Read More »

August 15, 2017

Given an array of n integers. Write a program to find minimum number of changes in array so that array is strictly increasing. In strictly… Read More »

July 30, 2017

Given an array containing n integers. The problem is to find the sum of the elements of the contiguous subarray having the smallest(minimum) sum. Examples:… Read More »

July 27, 2017

Given two sequences A, B, find out number of unique ways in sequence A, to form a subsequence of A that is identical to the… Read More »

July 9, 2017

Given two string X and Y. The task is to find the length of longest subsequence of string X which is substring in sequence Y.… Read More »

July 5, 2017

Given a sequence of n integers, you have to find out the non-decreasing subsequence of length k with minimum sum. If no sequence exists output… Read More »

Given a paper of size A x B. Task is to cut the paper into squares of any size. Find the minimum number of squares… Read More »

July 4, 2017

Given a string str of small alphabetic characters other than this we will be given many substrings of this string in form of index tuples.… 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 »