Don't Panic - Episode 1 - Puzzle discussion

Feel free to send your feedback or ask some help here!

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

A Djikstra Technique :wink:*

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

1 Like

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

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

9 Likes

Yes, first part is very simple, I asked about the second.

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 :confused:

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.

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

6 Likes

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

Again :smile:, I passed all the test cases but got 85% as couldn’t pass the first validation case.

wrong topic then :smiley:
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.

1 Like

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.