in reply to Re^2: Golf: Buying with exact change
in thread Golf: Buying with exact change
Another problem I have with the regex solution is that you don't know how much is enough for any given input. I'd say twice the largest 2 number would do it but I'm not sure, there will be complications when some of the numbers share factors.
It's an interesting puzzle though, it has a very simple solution when there's only 2 numbers:
largest(m, n) = (m - 1) * (n - 1) - 1 |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Golf: Buying with exact change
by Anonymous Monk on Feb 22, 2005 at 09:12 UTC |