The 100 prisoner riddle - counterintuitive puzzle

Thank you for both answers, crystal clear and easy to understand.