i am getting memory limit exceed, despite using constant memory… is it due to i am using recursion??
Yes. The use of recursion means that you are not using constant additional memory. Every recursion call uses stack memory for storing the arguments, and hence its additional memory theoretically and practically.
Anshuman Singh okay… and thanks for the prompt reply…