Problem 320 Accordion - issue with checker

Back to General discussions forum

Dan Nagle     2026-11-24 20:56:41

The checker is failing my answer on the first test case but the provided moves are valid.

Case: 6 D3 D2 S2 S3 D4 S4 Moves: 5j 4j 3j 2 1

Checker output: Move 5 is against rules in case 1

Walkthrough of moves:

D3 D2 S2 S3 D4 S4

5j : S4 onto S2, match on suit S

D3 D2 S4 S3 D4

4j : D4 onto D2, match on suit D

D3 D4 S4 S3

3j : S3 onto D3, match on rank 3

S3 D4 S4

2 : S4 onto D4, match on rank 4

S3 S4

1 : S4 onto S3, match on suit S

S4

If I hardcode a skip for the first case then the checker says "Move #1 is against rules in case 2".

I don't think that I misinterpreted the rules for moves.

Please login and solve 5 problems to be able to post at forum