Skip to content

Instantly share code, notes, and snippets.

View hotgrandma69's full-sized avatar

Victoria hotgrandma69

  • KnowRe
  • Seoul, South Korea
View GitHub Profile
@jianwu-github
jianwu-github / Solve "Counting Change" Problem with Scala
Last active March 17, 2022 16:36
Solve "Counting Change" Problem with Scala
/**
* Counting Change Problem:
* How many different ways can we make change of $ 1.00, given half-dollars, quarters, dimes,
* nickels, and pennies? More generally, counts how many different ways you can make change
* for an amount, given a list of coin denominations. For example, there are 3 ways to give
* change for 4 if you have coins with denomiations 1 and 2: 1+1+1+1, 1+1+2, 2+2.
*
* A standard algorithm using recursion is described in <a href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2.2">Tree Recursion</a>
* from MIT Press Book "Structure and Interpretation of Computer Programs" as:
* We can divide the ways to make change into two groups:
@robflaherty
robflaherty / csv-to-json.php
Created September 1, 2011 02:26
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed