P12 (**) Decode a run-length encoded list.
| 100 | |
| 101 | // P12 (**) Decode a run-length encoded list. |
| 102 | void problem_12() |
| 103 | { |
| 104 | const auto pair_to_vec = [](const size_t_int_pair& p) -> Ints { |
| 105 | return replicate(p.first, p.second); |
| 106 | }; |
| 107 | print_result(concat(transform(pair_to_vec, xs_run_length_encoded))); |
| 108 | } |
| 109 | |
| 110 | // P13 (**) Run-length encoding of a list (direct solution). |
| 111 | void problem_13() |
no test coverage detected