In a kingdom far far away, the King decided that the time
has come to find a husband for his princess daughter. The
King wanted to find a worthy lad for his princess, so he
promised to give his daughter away to the first young (or
old) man who would solve the puzzle that has stumped the
best of his court mathematicians for years. The puzzle is
very simple: in a palace, there are 25 rooms arranged in a
square--5 rows of rooms with 5 rooms in each row. In every
room there is a light switch which not only switches on/off
the light in that room, but also switches the lights in the
adjacent rooms--the room to the right, to the left, the
room above and the room below. Initially, all of the
lights are turned off. The goal is to turn the lights on
in every room of the palace.

Answers were Sorted based on User's Feedback

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

X1X1X Superman,if u on 4 lights,then switches of the
10101 room denoted by X will not be turned on.
X1X1X
10101
X1X1X
.........................................................
U have to on 7 lights

The room of which light need to on is indicated by 0,

11011
01110
11011
01110
11011

 Is This Answer Correct ? 37 Yes 5 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

1 1 0 0 0
1 1 0 1 1
0 0 1 1 1
0 1 1 1 0
0 1 1 0 1

1 - switch on the light

 Is This Answer Correct ? 8 Yes 3 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

00600
10003
00500
20004
00700

Need to switch on 7 lights.

 Is This Answer Correct ? 6 Yes 3 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

11111
10110
11111
11111
10110

0 indicates rooms you need to switch lights on... Its simple....

 Is This Answer Correct ? 2 Yes 0 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

only 1 light need to switch on, gradually the remaining all
will become on.

1 0 0 0 0
0 0 0 0 0
0 0 0 0 0---->
0 0 0 0 0
0 0 0 0 0

1 1 0 0 0
1 0 0 0 0
0 0 0 0 0---->
0 0 0 0 0
0 0 0 0 0

1 1 1 0 0
1 1 0 0 0
1 0 0 0 0----> like this
0 0 0 0 0
0 0 0 0 0

 Is This Answer Correct ? 12 Yes 11 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

X1X1X Superman,if u on 4 lights,then switches of the
10101 room denoted by X will not be turned on.
X1X1X
10101
X1X1X
.........................................................
U have to on 7 lights

The room of which light need to on is indicated by 0,

11011
01110
11011
01110
11011

Hi Ananya can you please explain this.

 Is This Answer Correct ? 1 Yes 1 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Hi Ananya,

I have doubt in your solution as well.

.........................................................
U have to on 7 lights

The room of which light need to on is indicated by 0,

11011
01110
11011
01110
11011

.........................................................
Suppose the room are numbered like
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25

Now,if room no. 3,6,10 were switched-on, this will switch-on
lights in the room (2,8,4);(1,7,11);(5,9,15) in that order
respectively. Now when 13th room light is lit, it will
switch-off the light of room no. 8 as well. So, if we follow
your approach, at last the lights from room no.s 8 & 18 will
be OFF.

 Is This Answer Correct ? 1 Yes 1 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

 Is This Answer Correct ? 0 Yes 0 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Sorry I did not understand the problem before ... My solution is wrong.

 Is This Answer Correct ? 0 Yes 0 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Switch on the first room light

 Is This Answer Correct ? 0 Yes 0 No

More Puzzles Interview Questions

In rail road there are some stations. Each station should have tickets to all other stations.If they add some new stations they need 46 more tickets.How many stations are there before and after adding the stations?

There are 3 ants at 3 corners of a triangle, they randomly start moving towards another corner. What is the probability that they don't collide?

how soon can you travel down to start your new job?

4 men can dig 4 holes in 4 days. How many hours does it take for 1 man to dig half a hole?

Four prisoners escape from a prison. The prisoners, Mr. East, Mr. West, Mr. South, Mr. North head towards different directions after escaping. The following information of their escape was supplied: ? The escape routes were North Road, South Road, East Road and West Road ? None of the prisoners took the road which was their namesake ? Mr. East did not take the South Road ? Mr.West did not the South Road ? The West Road was not taken by Mr. East What road did each of the prisoners take to make their escape

There are 25 horses and only five tracks in a race. How do you find the second coming horse of all the 25 horses, provided there is no stop clock? (obviously, a horse cannot participate more than once in a race).

If 5/2 artists make 5/2 paintings using 5/2 canvases in 5/2 days then how many artists r required to make 25 paintings using 25 canvases in 25 days?

in 10 hrs,if the cistern is filled ,then how much time the outlet takes to empty the cistern

There is a shortage of tubelights, bulbs and fans in a village - Kharghar. It is found that ?All houses do not have either tubelight or bulb or fan. ?exactly 19% of houses do not have just one of these. ?atleast 67% of houses do not have tubelights. ?atleast 83% of houses do not have bulbs. ?atleast 73% of houses do not have fans. What percentage of houses do not have tubelight, bulb and fan?

We have 2 poles 5 m and 7 m height ropes are connected from top of one to tthe bottem of another find the intersection height of those poles.

In one year there are 12 months,so how many years in one month

Gomzi has 3 timepieces in his house - a wall clock, an alarm clock and a wristwatch. The wristwatch is always accurate, whereas the wall clock gains 2 minutes everyday and the alarm clock loses 2 minutes everyday. At exactly midnight last night, all three watches were showing the same time. If today is 25 July 2003, then on which date all three clocks will show the same time again?

Categories