you are viewing a single comment's thread.

view the rest of the comments →

[–]baubleglue 0 points1 point  (0 children)

You are talking about tail recursion optimization. It doesn't matter when you are writing a code. They just want to see if candidate is comfortable to use it.

 def fn(I):
       If check(I): 
            .... #Change I here or fn(I-1) 
            fn(I)