IXL Learning Interview Question

Prisoners dilemma hat puzzle question