Emma (UK) interview question

Leetcode-style prisoner cells problem + generic array pointer problem.