Phone Keypad Problem

Solve a problem based on Recursion and Backtracking.

Problem statement

Before the advent of QWERTY keyboards, texts and numbers were placed on the same key. For example, 2 had ABC and if we wanted to write anything starting with A, we needed to type key 2 once. If we wanted to type B, key 2 had to be pressed twice, and thrice for typing C. Below is a picture of such a keypad.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.