+ 1
Print possible passwords with recursive function
Hello. I have to write a «recursive function» that prints the possible passwords of a lock to me. The password of this lock consists of four letters: a,o,u,i After the letter o, u or a can come. after u : o or i after a: u or o And after the letter i, neither of those three can be used. We take the «number of letters of password» and the «first letter» from the user as input And we have to print all the possible outputs. Can anyone solve it? Example: input: 5 o Output: oaoau oaoao oaoui oaouo oauoa oauou ouoao ouoau ououi ououo Example 2: Input: 6 i Output: 0
6 Respostas
+ 1
YUGRAJ thank you soooo much. that was perfect. I changed your code a bit and it finally looks like this:
Thanks again
https://code.sololearn.com/c430orK6t07p/?ref=app
+ 1
Aysha
I'm sorry. I really do not know the return function, otherwise I would not have discussed it here.
+ 1
Here what I tried is it correct?
+ 1
Aysha thanks☺️
+ 1
Yeah nice😀😀