P11 - Modified run-length encoding.
Author: David Romano
P11 (*) Modified run-length encoding. Modify the result of problem P10 in such a way that if an element has no duplicates it is simply copied into the result list. Only elements with duplicates are transferred as (N E) lists.
> encode_modified(<a a a a b c c a a d e e e e>).perl.say ([4, "a"], "b", [2, "c"], [2, "a"], "d", [4, "e"])
Source code: P11-unobe.pl