Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
To check if number x is a power of 5 or not, we will divide x by 5 while x > 1 and x mod 5 == 0. After iteration if x == 1, then it was a power of 5.
Since the constraint of s.length is small, we can use recursion to find all the partitions.