Binary Watch

Easy · Bit Manipulation · about 10 minutes

Asked at Google, Amazon, Microsoft.

A binary watch has 4 LEDs for the hour (0–11) and 6 LEDs for the minute (0–59). Given turnedOn, the number of lit LEDs, return every time it could show, formatted "h:mm" (no leading zero on the hour, two-digit minutes), in any order.