Initial commit
Test (in pplus-core) / in-core (push) Failing after 28m44s

This commit is contained in:
alexm committed 2026-11-12 22:23:48 -05:00
commit 568474d52f
1591 files changed
+528213

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
# origin: Programming+ exercise kmers
# status: unverified; `corpus.py verify` checks it on the pinned compiler
# probe: how many times each word of k letters occurs in t
# expect-stdout: {GAT: 2, ATT: 2, TTA: 1, TAC: 1, ACA: 1, CAG: 1, AGA: 1}
def kmer_counts(t: String, k: Int) raises -> Dict[String, Int]:
# requires: k >= 1
var counts = Dict[String, Int]()
var n = t.count_codepoints()
for i in range(n - k + 1):
var word = String("")
for j in range(k):
word += String(t[codepoint=i + j])
if word in counts:
counts[word] += 1
else:
counts[word] = 1
return counts^
def main() raises:
print(kmer_counts("GATTACAGATT", 3))