MCPcopy Create free account
hub / github.com/douchuan/algorithm / make_changes

Function make_changes

tests/test_dp.rs:4–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3#[test]
4fn make_changes() {
5 let coins = vec![1, 2, 5];
6 //(min coins, amount)
7 let solutions = vec![
8 (3, 11),
9 (3, 12),
10 (4, 13),
11 (4, 14),
12 (3, 15),
13 (4, 16),
14 (4, 17),
15 (5, 18),
16 (5, 19),
17 (4, 20),
18 ];
19 for (expect, amount) in solutions {
20 assert_eq!(expect, dp::coin::make_change_classic(&coins, amount));
21 assert_eq!(expect, dp::coin::make_change_iter(&coins, amount));
22 }
23}
24
25#[test]
26fn make_changes_fail() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected