One in One out - Google interview question?
2 posters
One in One out - Google interview question?
You have an empty room, and a group of people waiting outside the room. At each step, you may either get one person into the room, or get one out. Can you make subsequent steps, so that every possible combination of people is achieved exactly once?
Beagle- Posts : 40
Join date : 2009-01-30
Re: One in One out - Google interview question?
imagine this for 3 people.
000
001
011
010
110
111
101
100
where the nth bit represents whether nth person is inside or not.
if u remember this was GREY CODE.
000
001
011
010
110
111
101
100
where the nth bit represents whether nth person is inside or not.
if u remember this was GREY CODE.
Permissions in this forum:
You cannot reply to topics in this forum
|
|