Improve is_pandigital function performance for problem32