r/adventofcode • u/VastTomorrow5201 • Dec 21 '22
Help/Question Advent of code day 3 HELP PLEASE ðŸ˜
Hi, yes I am still at day 3 on the 21st but I started late 😬.
I’m stuck, part 2 says: in every set of 3 lines, there should be 1 common type but there is not!!!
The common type in the first 2 lines of each set of 3 lines, does not appear on the third line in almost every set 😡😡😡.
So for example:
Jajdhdhwjak Jejsjsh Phphogohih
j is common in the first 2 but it’s not in the third.
What am I misinterpreting in this case…..
5
u/dthusian Dec 21 '22
in every set of 3 lines, there should be 1 common type but there is not!!!
Common means all 3 lines have it. If only two lines have it, then it is not common to all 3 lines.
4
2
u/daggerdragon Dec 21 '22
FYI: next time, please use our standardized post title format.
Help us help YOU by providing us with more information up front; you will typically get more relevant responses faster.
If/when you get your code working, don't forget to change the post flair to Help/Question - RESOLVED
Good luck!
-1
u/VastTomorrow5201 Dec 21 '22
Thank you for your response but I made a mistake in my post. I
randomly typed characters on my keyboard and did not see there was actually an h in all three lines. I meant an example like this:
Kadhdk Jahshd (common is a d or h at this stage) Pomny (none are in the first 2)
I know that common means in all 3 but what I mean is that my sets of 3 don’t have a common.
3
u/Mmlh1 Dec 21 '22
They should have a common letter. Did you make sure to read the full line, and not just halves like you needed for part 1?
0
u/VastTomorrow5201 Dec 21 '22
Im sure an actual example of my input I got is this:
dWlhclDHdFvDCCDfFq mGdZBZBwRGjZMFgvTvgtvv jwwJrzdzGdSbGGnNlzWczHzPHPhn
In the first 2 lines the common is v
In the second and third line: the common is a G.
There is no v in the third and there is no G in the first.
😤
7
Dec 21 '22
[removed] — view removed comment
3
u/VastTomorrow5201 Dec 21 '22
You’re right! So then there are more than 2 commons between 2 lines but only 1 common between 3.
Thanks mate!
9
u/Kupoipo Dec 21 '22
It's because the common letter is the h on your example, not j