RosettaCodeData/Task/Ordered-words/D/ordered-words-3.d
2023-07-01 13:44:08 -04:00

7 lines
275 B
D

void main() {
import std.stdio, std.algorithm, std.range, std.file, std.string;
auto words = "unixdict.txt".readText.split.filter!isSorted;
immutable maxLen = words.map!q{a.length}.reduce!max;
writefln("%-(%s\n%)", words.filter!(w => w.length == maxLen));
}