SPOJ – ABA12C ( Buying Apples)

November 25, 2017

User wants to buy K kilograms of apples for N friends, and each kilogram of apples has cost attached to it. If the cost is set as -1, then user cannot buy that. User can buy as many quantity of a particular kg of apple. Minimize the cost and see if all N friends can get apples with this selection, if not print -1. Read the rest of this entry »


Coin Change – HR

October 10, 2017

Given a list of coins and a target sum, find the number of ways to make that sum. Read the rest of this entry »


October 8, 2017

Starting from coordinate 0,0 if numbers are added to coordinates alternatively in diagonal (2 lines), find the number that is stored in x,y coordinate. If no number was stored, print “No Number”. Read the rest of this entry »


October 3, 2017

Given transitive dependency of some string and duplication of the keys, use the keys that pertains to last value and the final value of the dependency to replace the original values. Read the rest of this entry »


October 2, 2017

Transform the expression to Reverse Polish Notation. Read the rest of this entry »

Maximum SubArray – Leetcode

October 2, 2017

Calculate the maximum sum between contiguous subarray. Read the rest of this entry »


September 28, 2017

Find the minimum number of characters that needs to be added to a string to make is palindrome. Read the rest of this entry »


September 28, 2017

Given a line that starts with acronym and has bunch of insignificant words. How many ways the acronym can be formed using significant (not insignificant) words so that each word has at least one char contributing to the acronym. Read the rest of this entry »

SAMER08D – DNA Sequences – SPOJ

September 26, 2017

Given two string, find the longest subsequence matching substrings of at least k sizes. Read the rest of this entry »

Square Brackets – SPOJ

September 24, 2017

Given n integers and k values <= 2n. Find the number of proper bracket expressions (proper starting and ending brackets) with “[” enforced in each p[k] positions. Read the rest of this entry »