Baseline: tree as shared

This commit is contained in:
alexm committed 2026-10-05 03:03:38 +00:00
commit 659c03bbf8
1471 files changed
+990535

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
# origin: Programming+ exercise count-base (was translations.mojo, by course staff)
# status: unverified; Stage 1 verifies it on the pinned compiler
# probe: does the course's hand-written count_base compile and agree with the pseudo?
# expect-stdout: 3
def count_base(b: String, t: String) -> Int:
var total = 0
for i in range(t.count_codepoints()):
if String(t[codepoint=i]) == b:
total += 1
return total
def main():
print(count_base("A", "GATTACA"))