Smart keypad (what is error sir)

solve this problem using recursion