-->
当前位置:首页 > 题库

PROGRAMMING:Solving string number combination

Luz5年前 (2021-05-10)题库432
Itertools, Python's built-in module, provides very useful functions for manipulating iterated objects. Combinations and permutations are functions for solving combinations and permutations. Please input a string composed of upper and lower case letters and an integer n, remove the upper and lower case letters in the string and only keep the number string, and output the n-bit full combination of the number string after de duplication.
###Input format:
For example:
In the first line, enter a string containing at least one numeric character, for example: abc12de3de125de4 (the number string after de duplication: 12354);
In the second line, enter an integer n: (ensure that n is less than or equal to the length of the digit string after de duplication).
###Output format:
After de duplication, the number string is combined from large to small. Each combination takes one line, and there are no spaces between the characters. The output order is dictionary order.
###Input example:
Here is a set of inputs. For example:
```in
ABC12DE3De125DE4
three
```
###Output example:
The corresponding output is given here. For example:
```out
five hundred and forty-three
five hundred and forty-two
five hundred and forty-one
five hundred and thirty-two
five hundred and thirty-one
five hundred and twenty-one
four hundred and thirty-two
four hundred and thirty-one
four hundred and twenty-one
three hundred and twenty-one
```







answer:If there is no answer, please comment