Skip to content

Files

Latest commit

29f1a1d · Apr 10, 2015

History

History
9 lines (6 loc) · 665 Bytes

ruby-kata-minimum-coins.md

File metadata and controls

9 lines (6 loc) · 665 Bytes

Write a method def minimum_coins(number) which takes a number as an argument (ranging from 1 to 250) and returns the minimum number of coins needed to calculate number. Coins here represent the following values: 1, 5, 10, 25, 50 and 100. Consider the following examples:

  • The minimum number of coins to generate 35 would be 2: 10 and 25.
  • The minimum number of coins to generate 37 would be 4: 1, 1, 10, 25.
  • The minimum number of coins to generate 101 would be 2: 1 and 100.

Notes:

  • Do the assignment with TDD if you want some TDD practice (you likely will need another file in addition to code.rb for your test suite if you choose to do this)!