Smart keypad advanced

can someone please tell me how to approach this problem with the help of sample cases?

hi sarthak
have u done smart keypad -1
question
?