P11 (*) Modified run-length encoding.
| 87 | |
| 88 | // P11 (*) Modified run-length encoding. |
| 89 | void problem_11() |
| 90 | { |
| 91 | const auto modify = [](const auto& p) -> Ints { |
| 92 | return p.first == 1 ? Ints({ p.second }) |
| 93 | : Ints({ static_cast<int>(p.first), p.second }); |
| 94 | }; |
| 95 | |
| 96 | print_result(fwd::apply(xs, |
| 97 | fwd::run_length_encode(), |
| 98 | fwd::transform(modify))); |
| 99 | } |
| 100 | |
| 101 | // P12 (**) Decode a run-length encoded list. |
| 102 | void problem_12() |
no test coverage detected