MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / problem_12

Function problem_12

examples/99_problems.cpp:102–108  ·  view source on GitHub ↗

P12 (**) Decode a run-length encoded list.

Source from the content-addressed store, hash-verified

100
101// P12 (**) Decode a run-length encoded list.
102void 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).
111void problem_13()

Callers 1

mainFunction · 0.85

Calls 4

print_resultFunction · 0.85
replicateFunction · 0.50
concatFunction · 0.50
transformFunction · 0.50

Tested by

no test coverage detected