@Shubhamishere So, you understand how mystery(pointer, value) , changes the pointer on each recursion step. Notice the following is happening with each call of the mystery function:

**mystery(x, 2023) ---- ***2023 mod 4 =3*

**mystery(x + 1, 2021) ----- ***2021 mod 4 =1*

**mystery(x, 2019) ----- ***2019 mod 4 = 3*

**mystery(x+1, 2017) ----- ***2017 mod 4 =1*

*Rest you can figure out on your own. *

Why mod 4? See we want to know the first argument to the function ** mystery() **, that is , the

**pointer**.

To know that we must understand the pattern. We can clearly see the pattern that, **pointer **returns back to address **x** when the second argument is 3mod 4 and **pointer **returns back to address **x+1** when the second argument is 1mod 4.

I hope this clears your doubt.