Last letter-first letter: Difference between revisions
Content deleted Content added
Added zkl |
Updated D version 4 |
||
Line 1,255: | Line 1,255: | ||
std.container, std.range; |
std.container, std.range; |
||
auto findChain(in string[] seq) /*pure |
auto findChain(in string[] seq) /*pure*/ nothrow { |
||
const adj = seq |
const adj = seq |
||
.map!(item => tuple(item, |
.map!(item => tuple(item, seq |
||
.filter!(x => x[0] == item[$ - 1]) |
|||
.array)) |
|||
.array)) |
|||
.assocArray; |
.assocArray; |
||
SList!string res; |
SList!string res; |
||
foreach (immutable item; adj.byKey) { |
foreach (immutable item; adj.byKey) { |
||
void inner(in string it, SList!string lst) nothrow { |
void inner(in string it, SList!string lst) nothrow { |
||
lst.insertFront(it); |
lst.insertFront(it); |