Broadcom interview question

some standard leet code Qs