Project Euler 719 - Number Splitting

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

Note: I am quite happy with my solution and understanding of the problem however my code took a good 15 mins to run