in the solution, the value of f in rec(x-1) is used in rec(x) and ....f in rec(x) is used in rec(x+1) and so on..
my doubt is that as f is static , f should give the same value for both rec(x) and rec(x+1)?but this is not happening.
what is wrong with my approach? please explain.