I remember solving this problem during a pub crawl in Budapest in 2008. While somewhat drunk and with
many hints it took me ~1h to solve the first part. Then
Michal, who was posing the problem, said "what about if you don't know the inital state of the switch" and I immediately answered "ah, they just do it twice". IIRC, he looked at me a bit puzzled and said, "that's weird, it took me more time to solve the second half than the first."