My solution in python. Sometimes the challenge is just clicking what the description is actually saying, once it's obvious that these are just binary numbers then it was quite an easy one.
all_seats=[int((l.replace('B','1').replace('F','0').replace('R','1').replace('L','0')),2)forlinopen('input.txt')]print(f"Part 1: Highest seat is {max(all_seats)}")your_seat=[sforsinrange(min(all_seats),max(all_seats))ifsnotinall_seats][0]print(f"Part 2: Your seat is {your_seat}")
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.
My solution in python. Sometimes the challenge is just clicking what the description is actually saying, once it's obvious that these are just binary numbers then it was quite an easy one.