Smart Keypad - I : How to solve this question through recursion?

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

Ayush this is not the solution of smart keypad 1
r u talking about this question https://hack.codingblocks.com/contests/c/787/96
or any other if any other then post the link

I am so sorry this doubt is not related to this problem.