Anonymous user
Run-length encoding: Difference between revisions
m
→Linq
m (→Linq) |
m (→Linq) |
||
Line 700:
public static string Decode(string input) => input
.Scan((val: '\0', key: 0, next:0), (scn, chr) =>
(val: chr, key: scn.next, next: !char.IsDigit(chr) ? scn.next +1 : scn.next))
.Skip(1)
.GroupBy(t => t.key, (_, grp) => grp.Select(c => c.val))
|