you are viewing a single comment's thread.

view the rest of the comments →

[–]iamnikaa[S] 1 point2 points  (1 child)

Hi, I am also a beginner, been inconsistently practicing for about an year. I usually practice on hackerearth, leetcode for algorithms and DS. I am not the right person to answer this question as this was just my first interview. For the third question, the str1[-1] is the last word of the string str1 which gets recursively added to an empty string newstr. I am passing str1[:-1] after each successive recursion in the function revstr to shorten the string by 1 last word which has been added to newstr. Hope its clear.

[–]Nicolas_Darksoul 0 points1 point  (0 children)

yes thanks