Cognizant interview question

recursion using the python and r