How to find all combinations of coins when given some dollar value [closed]

I looked into this once a long time ago, and you can read my little write-up on it. Here’s the Mathematica source. By using generating functions, you can get a closed-form constant-time solution to the problem. Graham, Knuth, and Patashnik’s Concrete Mathematics is the book for this, and contains a fairly extensive discussion of the … Read more

Translate a string using a character map [closed]

The built-in function you seem to be looking for is str.translate: S.translate(table [,deletechars]) -> string Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256 or None. … Read more