Medium data structure and algorithm practice puzzle.
Given a page table tree where a non-zero value is a real mapping and 0 is an empty slot, return how many levels a walk has to descend to reach the deepest mapping. Empty branches do not count, so a tall tree of nothing is depth 0. This decides how many memory reads one translation costs before the TLB caches it, which is why x86-64 settled on four levels and not eight: each one is another trip to RAM.
Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free.
Browse all 536 puzzles