Ghost legs puzzle solution in browser different from local run

Hello!

I’m running the same C++ code in my local IDE (Visual Studio) and in the browser, yet the output for one of the test shows an incorrect solution in the browser. I don’t see why the solutions would differ, and it won’t pass all the test because of it. The test is the third one, “6 lanes”:

Input:
16 14
F E D C B A
| |–| | | |
|–| |–| |–|
| |–| |–| |
| | | | |–|
| |–| |–| |
| | |–| | |
| | |–| |–|
|–| | |–| |
| | |–| | |
|–| | | |–|
| |–| | | |
| | |–| | |
0 1 2 3 4 5

Output from browser:

Standard Output Stream:

A4
E1
F3
D0
C2
B5

Output from local run:
F3
E1
D0
C2
B5
A4

I’m using an unordered_map to store and print the values. It stores the labels as they come and should print them as such.

4 posts were merged into an existing topic: Ghost legs Puzzle -HELP!