aoc-2018-python

Advent of Code 2018 Solutions in Python
git clone https://git.sinitax.com/sinitax/aoc-2018-python
Log | Files | Refs | README | sfeed.txt

part2 (1210B)


      1--- Part Two ---
      2
      3Packets sent to address 255 are handled by a device called a NAT (Not Always Transmitting). The NAT
      4is responsible for managing power consumption of the network by blocking certain packets and
      5watching for idle periods in the computers.
      6
      7If a packet would be sent to address 255, the NAT receives it instead.  The NAT remembers only the
      8last packet it receives; that is, the data in each packet it receives overwrites the NAT's packet
      9memory with the new packet's X and Y values.
     10
     11The NAT also monitors all computers on the network.  If all computers have empty incoming packet
     12queues and are continuously trying to receive packets without sending packets, the network is
     13considered idle.
     14
     15Once the network is idle, the NAT sends only the last packet it received to address 0; this will
     16cause the computers on the network to resume activity.  In this way, the NAT can throttle power
     17consumption of the network when the ship needs power in other areas.
     18
     19Monitor packets released to the computer at address 0 by the NAT.  What is the first Y value
     20delivered by the NAT to the computer at address 0 twice in a row?
     21
     22