+ 2
Is my implementation of Recursion practical for the Producton Server ?
3 Antworten
+ 3
Rik Wittkopp Sir, TEST is a RESERVED WORD 😈😈😈
+ 2
Sanjay Kamath
I tested your code.
inputs
test
t
result -> 0
This indicates your code is not functioning as required.
PS: it is also not recursion because you are using a while loop.
Remember that recursion needs a base case to exit the loop, so you must figure out how to create this base case.
You must also inspect each letter of the word to see if it matches your chosen letter.
This could be done with a slice
It is also possible to remove letters of a string using pop()
With these concepts in mind, yiu could create a recursive function that has a base case of
len(word) ==0
You could then inspect each letter using word[slice], add your count if it matches, then remove, pop(slice)
See if you can put it together
+ 1
Rik Wittkopp Test data :
are you welcome 1st line + Enter
O 2nd line then submit
Frankly the testcases pass without error in the return and Search exercises....don't know why ?..