jeudi 26 février 2015

Question regarding Recurison on Python


I am way in over my head with a question that I am trying to solve. The question goes as follows:


Write a function that takes a positive integer and returns the number of ten-pairs it contains. A ten-pair is a pairs of digits within that sum to 10. Do not use any assignment statements.The number 7,823,952 has 3 ten-pairs. The first and fourth digits sum to 7+3=10, the second and third digits sum to 8+2=10, and the second and last digit sum to 8+2=10





Aucun commentaire:

Enregistrer un commentaire