Codercise V.3.3 - Numbering partition

Hi!
Such a coincidence. Another user asked almost the same question.
Check the answer I gave them. Hope it helps.