mercredi 19 février 2020

How to check how many subsets of a number there are?

Pretty straight-forward, if we have n=153175 and x=15; then s=3 (number of subsets), because we can make the number 15 from the digits in n, only 3 times. It counts only if its from left to right. I thought about different methods, but don't seem very optimal, I suppose it has some way, anybody help please? (The first 1 and the second 5, the first 1 and the last 5, and the second 1 and the last 5)




Aucun commentaire:

Enregistrer un commentaire