Akamai interview question

Since I am a chess player, a coding question was based on that