Project Euler 165 - Intersections

Official link: https://projecteuler.net/problem=165