Epic interview question

colorful number programming