# Don't Panic - Episode 1 - Puzzle discussion

Hi
Where is discussion ?
What techniques did you use for solving second part of the challenge?

A Djikstra Technique *

Do you mean to search minimal path from generator to the exit, where nodes of the graph are every possible position and elevators?

I used Dynamic Programming (DP) approach for this puzzle,

The DP returns the minimum number of steps to go finish the game. The states are the position of the clone, the floor of the clone, the direction of the clone, and the number of remaining elevator that can be build.

The second puzzle is much more interesting, this one is simple:

1. if HeadClone is in the wrong direction -> Block
2. profit

No need for fancy stuff

7 Likes

1 Like

what language have you used?

The input for elevators positions is wrong for test cases 5,6,7 in Level 1.

5 Likes

What makes you think that? Everything is fine for me

During my debug I print the elevators positions and found that itâ€™s correct in the first 4 test cases but wrong in the last 3.

2 Likes

I just checked all the test cases for the excercice and could not find anything wrong. Are you sure youâ€™re reading them correctly ?

These are the positions I print in all test cases:
(1) Correct
NoÂ Elevators
(2) Correct
Elevator[0]:7
(3) Correct
Elevator[0]:3
(4) For this case ran two times, the first failed but the second succeeded (no change in the code)
Elevator[0]:19
Elevator[1]:4
Elevator[2]:19
(5) Wrong
Elevator[0]:15
Elevator[1]:10
Elevator[2]:14
Elevator[3]:12
Elevator[4]:18
Elevator[5]:6
(6) Wrong
Elevator[0]:10
Elevator[1]:12
Elevator[2]:10
Elevator[3]:12
Elevator[4]:10
Elevator[5]:10
Elevator[6]:12
Elevator[7]:12
(7) Wrong
Elevator[0]:9
Elevator[1]:11
Elevator[2]:13
Elevator[3]:15
Elevator[4]:7
Elevator[5]:7
Elevator[6]:2
Elevator[7]:9

2 Likes

Elevators arenâ€™t given in the floor order so if you ignore the elevator floor information (read carefully the puzzle statement about initialization input), youâ€™ll obviously get bad resultsâ€¦

Here are an example of initialization input for test 5:

``````7 24 200 6 17 40 0 6
3 18
1 10
2 6
5 12
0 14
4 15
``````

You can check these, there are all correct. The first line will always be the same, but the order of the next 6 will change.

2 Likes

Yes, you are right. Many thanks for your help :).

Again , I passed all the test cases but got 85% as couldnâ€™t pass the first validation case.

wrong topic then
The paranoid android one step further

1 Like

Guuuuys!! You really shouldnâ€™t put such a simple puzzle into medium section =( After all that pain Iâ€™ve suffered in Mars Lander II this one is a childâ€™s play! It took about half an hour of my time. Two ifâ€™s and two elseâ€™s is all that is needed there.

Once you realize that 1) EVERY floor has either exit or elevator and 2) exit is ALWAYS on the highest floor, you pretty much solved it.

I think Mars Lander II is the one that is in the wrong place. I believe it could be a hard one. Medium ones include Indie level 1 and network cabling, which are also pretty easy

1 Like

I read the problem carefully and I could not figure what happens when 2 clones going in 2 different directions move to the same position ?
PS: I didnâ€™t test because I want to code everything from the problem statement.