Working out solutions for Advent of Code
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 5 gadiem
12345678910
  1. def main():
  2. with open("01ain.txt", "r") as file:
  3. lines = file.readlines()
  4. masses = [int(x) for x in lines]
  5. fuels = [(x//3) - 2 for x in masses]
  6. print(fuels)
  7. print(sum(fuels))
  8. if __name__ == "__main__":
  9. main()