3 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Reverend Jim

Here's an interesting little scenario. You get challenged to a game of coin toss. Both players pick a sequence of coin toss results (heads or tails). The coin is repeatedly tossed until the sequence for one of the players occurs. The loser pays the winner a dollar. You'd assume that …

Member Avatar for xrjf
0
2K
Member Avatar for vegaseat

Again, calculate the minimum number of bills or coins required for a given amount of money (change). This time we will use a Go map instead of a csv string converted to a structure.

0
407
Member Avatar for vegaseat

This Go snippet calculates the minimum number of bills or coins needed for a given amount of money (change) requested. The program also gives the denomination and number. US curency is used in this example, but can be changed to another currency.

1
452

The End.