My Advent of Code solutions in Python. kevinyap.ca/2019/12/going-fast-in-advent-of-code/
advent-of-code python
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update day07.py

+5 -10
+5 -10
2016/day07.py
··· 31 31 if not any(is_abba(h) for h in hypernets): 32 32 tls_ips += 1 33 33 34 - abas = set() 35 - 36 34 for seq in sequences: 37 - for aba in find_abas(seq): 38 - abas.add(aba) 35 + for a, b in find_abas(seq): 36 + bab = b + a + b 39 37 40 - for aba in abas: 41 - bab = aba[1] + aba[0] + aba[1] 42 - 43 - if any(bab in h for h in hypernets): 44 - ssl_ips += 1 45 - break 38 + if any(bab in h for h in hypernets): 39 + ssl_ips += 1 40 + break 46 41 47 42 print "Number of TLS IPs: %i" % tls_ips 48 43 print "Number of SSL IPs: %i" % ssl_ips