sort, .array and folding on immutable data (finding most common character in column of matrix)
Ali via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Dec 19 23:19:13 PST 2016
On Monday, 19 December 2016 at 12:45:48 UTC, Nicholas Wilson
wrote:
>
> Ah, oh well. It was nice in theory.
>
Indeed. Thank you for trying Nicholas :)
>
> auto word = data.map!(reduce!max).array.map!"a[1]".array;
>
> you want
>
> auto word = data.map!"a[1]".map!(reduce!max).array;
>
Problem max has to performed on the frequency part of the tuple
and "word" has to result in a concatenation of all the character
parts of the highest frequencied letters. So that up there will
result in "word" = 364782 // or something.
More information about the Digitalmars-d-learn
mailing list