← Back to archive

Stdle #11 · strings · 2026-06-17

What does this Zig snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const std = @import("std");
pub fn main() void {
const s: []const u8 = "abcdef";
std.debug.print("{d}\n", .{std.mem.count(u8, s, "c")});
std.debug.print("{d}\n", .{std.mem.count(u8, "banana", "an")});
}
Strings
2 lines
4 attempts left

Answer & explanation