You are given an array
bulbsof integers between 1 and 100.There are 100 light bulbs numbered from 1 to 100. All of them are switched off initially.
For each element
bulbs[i]in the arraybulbs:
- If the
bulbs[i]^thlight bulb is currently off, switch it on.- Otherwise, switch it off.
Return the list of integers denoting the light bulbs that are on in the end, sorted in ascending order. If no bulb is on, return an empty list.
1 | class Solution { |