------art_2964_23628516.1201702616518
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

My Solution:

class Array
>
>   def sum
>     inject(0){|sum, n| sum + n;};
>   end
>
> end
>
> class ChangeError < StandardError; end
>
> def make_change(amount, coins5, 10, 5, 1])
>   change  oins.sort.reverse.inject([]) do |change, coin|
>     change << coin until change.sum + coin > amount;
>     change;
>   end
>   raise ChangeError unless change.sum amount;
>   change.sum;
> end
>

-- 
Bernardo Rufino

------art_2964_23628516.1201702616518--