I just used a hack to solve this question. But I want to learn the recursive approach to solve this problem as I am weak in recursion.
I also tried to unlock the editorial, but it said “No editorial exists for this problem”. That’s why I need mentor’s help. My approach : https://ide.geeksforgeeks.org/gZw7GnM6Wi