Hi, new to this site, and AOC. I did the last 4 in Python, but I thought I would try shell for this one (i'm not great at shell so this may be not the best):
#!/bin/bashi=0;for seat in$(cat ids)do((i=i+1))((prev=i-1))((next=i+1))if grep--silent ^${prev}$ ids
then
if grep--silent ^${next}$ ids
then
if!grep--silent ^${i}$ ids
then
echo"${i}"fi
fi
fi
done
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, new to this site, and AOC. I did the last 4 in Python, but I thought I would try shell for this one (i'm not great at shell so this may be not the best):
I solved part 1 with this shell oneliner...
for part two, I created the list of passport ids with:
then threw this at the ids file: