Python solution for 17-use-all-the-digits