31
points
Questions
0
Answers
4
-
Minimum visit=1 and Maximum vist=2
On Switch A and check (visit one )
if bulb is on then Switch a is bulb switch if not
Turn off A and turn on B, go to room and check (second visit)
if bulb is on the switch B is bulb switch , else switch C
- 61603 views
- 5 answers
- 1 votes
-
Minimum visit=1 and Maximum vist=2
On Switch A and check (visit one )
if bulb is on then Switch a is bulb switch if not
Turn off A and turn on B, go to room and check (second visit)
if bulb is on the switch B is bulb switch , else switch C
- 61603 views
- 5 answers
- 1 votes
-
We have only 2 eggs if both eggs are broke. we can’t use more eggs
this is actual algorithm to find the Nth step
- We need to start from 1st floor and throw the egg
- If egg didn’t broke move to 3rd floor (+2)
- and we can continue till 99 if egg didn’t break in 99th floor then 100th floor is Nth
- if the egg break in anywhere(ex: 57) we need to check x-1 floor too with another egg ( so 56th)
- if the egg break on 56th floor then 56 floor is N otherwise 57 is N
- 175281 views
- 15 answers
- 2 votes
-
We have only 2 eggs if both eggs are broke. we can’t use more eggs
this is actual algorithm to find the Nth step
- We need to start from 1st floor and throw the egg
- If egg didn’t broke move to 3rd floor (+2)
- and we can continue till 99 if egg didn’t break in 99th floor then 100th floor is Nth
- if the egg break in anywhere(ex: 57) we need to check x-1 floor too with another egg ( so 56th)
- if the egg break on 56th floor then 56 floor is N otherwise 57 is N
- 175281 views
- 15 answers
- 2 votes