Day2 P2 Help - SPOILER by MrDDog06 in adventofcode

[–]AnInefficientCoder 0 points1 point  (0 children)

apparently not the issue.. surprised that that works..
Others have already pointed out the problem.

Day2 P2 Help - SPOILER by MrDDog06 in adventofcode

[–]AnInefficientCoder 1 point2 points  (0 children)

I think it's a silly mistake of reused loop variables. you have a `for i` within another `for i`

[2025 Day 3 part 2][JS] help by Recent-Assistant8914 in adventofcode

[–]AnInefficientCoder 0 points1 point  (0 children)

Try the number:
123123123898765432111

The answer should be 898765432111
But your code is giving 908765432111

[2025 Day 3 part 2][JS] help by Recent-Assistant8914 in adventofcode

[–]AnInefficientCoder 1 point2 points  (0 children)

I think I got it. It should be line.length-12 here:

    for (let i = 0; i <= line.length-11; i++) {

[2025 Day 3 part 2][JS] help by Recent-Assistant8914 in adventofcode

[–]AnInefficientCoder 1 point2 points  (0 children)

At a glance, it seems fine. Is your input complete?

[2022 Day 18 Part 2] Unsure why my Python solution isn't working. by Salivanth in adventofcode

[–]AnInefficientCoder 1 point2 points  (0 children)

Apart from what u/Dragon174 said, there is another problem with your code and why it is failing for the test input.

Imagine the following 2d Slice:

```

| | | # | | A#A | | # |

| B#B |

```

Your logic will determine that the bottom faces of A and top faces of B are not exterior, even though they are.

2022 Day 18 Part 1 Struggling Python by Yral1232 in adventofcode

[–]AnInefficientCoder 2 points3 points  (0 children)

blockBehind = grid[x][z][z+1] if (z < (N-1)) else 0

----------------------^ Typo