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 |
In reply to Re^3: Golf: Buying with exact change
by fergal
in thread Golf: Buying with exact change
by blokhead
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |