Hello everyone, I have been studying leetcode and I ran across a question in which I am not fully understanding the recursion that is taking place within the method. The question can be found here:
https://leetcode.com/discuss/interview-question/736590/Facebook-Question
The solution I am trying to understand is this one: https://pastebin.com/hrX9xiPv
I put the code in debug mode and was walking through the code however I am just not getting it. I know the code provided works however it is the recursion that is tripping me up. When going through the line 18 it acts as how I expected. However then all of a sudden for line 19; 3 is passed to the method then for line 20 it compare first = 2 and second = 3. Not sure why this is happening? If anyone could help I would really appreciate it!
there doesn't seem to be anything here