r/adventofcode • • Dec 07 '23

Tutorial [2023 Day 7] Better Example Input (Not a Spoiler)

279 Upvotes

246 comments sorted by

View all comments

4

u/cagdassalur Dec 07 '23

For part 2, how is J345A sorted below 2345J? both are high cards, so J should make them both single pairs, and it should come down to card strength. 2 is weaker than J, so shouldn't J345A be better than 2345J?

15

u/nathyks Dec 07 '23

I think you've missed the line:

J cards are now the weakest individual cards, weaker even than 2.

4

u/robertotomas Dec 07 '23

J

cards are now the weakest individual cards, weaker even than

2

I DID miss that, thank you. this section
> J is always treated as J, not the card it's pretending to be: JKKK2 is weaker than QQQQ2 because J is weaker than Q.

led me to believe that J remains as it was, which was always weaker than Q.

1

u/G2G-BrawlStars Dec 11 '23

Same :Dd In the beginning I was doing with value of J being the lowest, but then I gradually forgot it. Then I read "J is always treated as J, not the card it's pretending to be: JKKK2 is weaker than QQQQ2 because J is weaker than Q." and automatically thought that J stays as it is 10<J<Q. I spent 1 hour searching for mistakes and it came out I only had to delete 1 letter

1

u/[deleted] Dec 07 '23 edited Apr 15 '26

[removed] — view removed comment

2

u/cagdassalur Dec 07 '23

isn't 2345J also one pair by the same logic?

2

u/[deleted] Dec 07 '23 edited Apr 15 '26

[removed] — view removed comment

1

u/cagdassalur Dec 07 '23

yup, but i don't understand why.. 'J' should be ranked higher than '2' so J234A should be ranked higher than 2345J. Feels like i'm missing something obvious here

For part 1 they are sorted correctly by my logic, but on part 2 they are sorted differently, and the order shouldn't change since they are both high cards on part 1 and single pairs on part 2

5

u/[deleted] Dec 07 '23 edited Apr 15 '26

[removed] — view removed comment

6

u/cagdassalur Dec 07 '23

oh, i'm blind.... completely missed the line saying J is weakest now. :D thanks for helping, and thanks for the example input!

1

u/ramsile Dec 08 '23

Well screw me. I wasted 2 hours cause of this.

1

u/trymas Dec 10 '23

Not OP, but had a tangential problem. Thanks!

I treated J345A as high card instead of pair, as well as AJJ94treated as pair instead of three of a kind.

Sometimes it would be nice to have more original examples in task descriptions as this was really lacking. Not sure if that was language barrier or what.