Pergunta de entrevista da empresa IXL Learning

jelly bean brain teaser, red and blue hats problem.