fn freq(text: Span<u8>, needle: u8) -> u32 {
    var count: u32 = 0
    var i: usize = 0
    while i < std.mem.len(text) {
        if text[i] == needle {
            count = count + 1
        }
        i = i + 1
    }
    return count
}

pub fn main(world: World) -> Void raises {
    if freq(std.mem.span("bananas"), 97) == 3 {
        check world.out.write("huffman ok\n")
    }
}
