RosettaCodeData/Task/Ordered-words/D/ordered-words-3.d

8 lines
275 B
D
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
void main() {
2015-02-20 00:35:01 -05:00
import std.stdio, std.algorithm, std.range, std.file, std.string;
2013-06-05 21:47:54 +00:00
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));
2013-04-10 16:57:12 -07:00
}