IXL Learning Interview Question

jelly bean brain teaser, red and blue hats problem.