RosettaCodeData/Task/Ordered-words/D/ordered-words-3.d
2015-02-20 00:35:01 -05: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));
}