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..

Answer / ananya

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..

Answer / daniela

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..

Answer / max

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..

Answer / pradip biswas

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..

Answer / alphy

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..

Answer / tirupathi

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..

Answer / sharmesh kumar

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..

Answer / dolly

7 is the correct answer which is provided by Md.Answer no:5

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..

Answer / pradip biswas

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..

Answer / guest

Switch on the first room light

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Puzzles Interview Questions

day before yesterday i was 25 years , next year iam 28,when is my birthday? which day is today?

8 Answers  


What will come in place of the question mark (?) in the following questions? 11.7589 ? ? = 3434 (a)3721 (b)4155 (c)3246 (d)11023 (e)None of these

7 Answers   BSRB,


find odd one out among these 25,36,49,64,81

19 Answers   CTS,


There is a bucket with lots of marbles. Some are red, some are blue, some are green and some are orange. We don't know the quantity of any. With your closed eyes how many minimum number of marbles you will pick so as to 100% sure that atleast 2 marbles have the same colors.

14 Answers   TCS,


Taurus+pisces =scorpio,substitute the digits for the following letter to make the following addition true?

5 Answers   Wipro,






There is a number that is 5 times the sum of its digits. What is this number? Answer is not 0.

2 Answers   MasterMind,


If one person sends the e-mail to two friends, asking each of them to copy the mail and send it to two of their friends, those in turn send it to two of their friends and so on. How many e-mails would have been sent by the time it did 30 sets?

2 Answers  


In a soap company a soap is manufactured with 11 parts. For making one soap you will get 1 part as crap. At the end of the day u have 251 such scraps. From that how many soaps can be manufactured?

0 Answers   Infosys,


i want to know tips if any one have any idea about interview at nielsen market research company

1 Answers   Nielsen,


There are 3 societies A, B, C. A lent cars to B and C as many as they had already. After some time B gave as many tractors to A and C as many as they have. After sometime c did the same thing. At the end of this transaction each one of them had 24. Find the cars each orginally had.

4 Answers   Infosys, TCS, Zoho,


Each of the five characters in the word BRAIN has a different value between 0 and 9. Using the given grid, can you find out the value of each character? B R A I N 31 B B R B A 31 N I A B B 32 N I B A I 30 I R A A A 23 37 29 25 27 29

1 Answers  


8. Given a collection of points P in the plane , a 1-set is a point in P that can be separated from the rest by a line, .i.e the point lies on one side of the line while the others lie on the other side. The number of 1-sets of P is denoted by n1(P). The minimum value of n1(P) over all configurations P of 5 points in the plane in general position (.i.e no three points in P lie on a line) is a) 3 b) 5 c) 2

6 Answers   TCS,


Categories