← Back to archive

Stdle #126 · slices · 2026-10-10

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 arr = [_]u8{ 10, 20, 30, 40, 50 };
std.debug.print("{d}\n", .{std.mem.lastIndexOf(u8, &arr, &[_]u8{30}).?});
}
Slices
4 attempts left

Answer & explanation