Domanda di colloquio di Scientific Games

Basic way to solve the problem in code