Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Letter-frequency/D/letter-frequency.d
Normal file
11
Task/Letter-frequency/D/letter-frequency.d
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
void main() {
|
||||
import std.stdio, std.ascii, std.algorithm, std.range;
|
||||
|
||||
uint[26] frequency;
|
||||
|
||||
foreach (const buffer; "unixdict.txt".File.byChunk(2 ^^ 15))
|
||||
foreach (immutable c; buffer.filter!isAlpha)
|
||||
frequency[c.toLower - 'a']++;
|
||||
|
||||
writefln("%(%(%s, %),\n%)", frequency[].chunks(10));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue