Project Euler 712 - Exponent Difference

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

Note: Code takes around ~560 seconds to run, but I am very happy with my solution