Solving SPOJ 346. Bytelandian Gold Coins (COINS) with Dynamic Programming and F#

The Bytelandian Gold Coins problem, officially published in SPOJ, is centered around computing the maximum dollars that can be exchanged for a Bytelandian gold coin. In this post, we outline a solution to this problem with memoization and F#.

Interpretation

The problem definition enforces following rules to perform the exchange. Consider, a Bytelandian gold coin --
 
noun_project_8551 It can be exchanged to three other coins, i.e., coins. Thus, coin yields value in bytelandian gold coins.
 
noun_project_8551 Alternatively, coin can be exchanged for dollars.
 
Our objective is to derive an algorithm that maximizes the dollars exchanged from the gold coin . (read more)

No Comments