Don't Panic - Episode 1 - Puzzle discussion


#1

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


Don't Panic - Episode 1: the statement could be clearer!
#2

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


#3

A* Djikstra Technique wink


#4

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


#5

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.


#6

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

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


#8

what language have you used?


#9

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


#10

What makes you think that? Everything is fine for me confused


#11

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.


#12

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


#13

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


#14

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.


#15

Yes, you are right. Many thanks for your help smile.


#16

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


#17

wrong topic then smiley
The paranoid android one step further


#18

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.


#19

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


#20

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.