007 top words

✓ Passing This code compiles and runs correctly.

Code

input.k

Supporting Files

input.txt

Actual

words 27
distinct 7
top 5:
1. the 6
2. of 5
3. cat 4
4. dog 4
5. ant 3
5 shown

Expected output

words 27
distinct 7
top 5:
1. the 6
2. of 5
3. cat 4
4. dog 4
5. ant 3
5 shown

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (ranked, capacity: 64, source: word: *std/string:String<std/string:instance!>, cnt: i64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (best, source: row: 0[i64], cnt: 0[i64])
subflow ~pick click a branch to expand · @labels scroll to their anchor
stored (source: best.row: -1, best.cnt: -1)
subflow ~report click a branch to expand · @labels scroll to their anchor
take (row]: ranked[best.row])
subflow ~top click a branch to expand · @labels scroll to their anchor
pick
flow ~new click a branch to expand · @labels scroll to their anchor
new
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "top 5:")
flow ~top click a branch to expand · @labels scroll to their anchor
top (left: 5, rank: 1)

Test Configuration

MUST_RUN