Question: Python I want to get a list of monotonically increasing subsets when given a string of numbers by using recursion When splitting a string into
Python
I want to get a list of monotonically increasing subsets when given a string of numbers "by using recursion"
When splitting a string into substrings, the integer represented by the first substring must exceed 'number'(second argument)
def increasing_number(string, number=0):
for example
print(increasing_number('123456')) output:
[[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 56], [1, 2, 3, 456], [1, 2, 34, 56], [1, 2, 3456], [1, 23, 456], [1, 23456], [12, 34, 56], [12, 3456], [123, 456], [123456]]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
