Qualcomm Interview Question

red/ black hats riddle