Files
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

15 lines
491 B
Mojo

# 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"))