6174 (using lists)

Sign in to test your solution.