Question: please write in JAVA In a typical cell phone keypad, each digit (from 2 to 9) corresponds to some letters (see below). 1 2 abc
please write in JAVA


In a typical cell phone keypad, each digit (from 2 to 9) corresponds to some letters (see below). 1 2 abc 3 def 5 6 4 ghi jkl mno 7 pers 8 tuv 9 wxyz * O # This corresponding relationship between digits and letters have been used, mainly in the United States, as a technique for remembering telephone numbers easily. For example, an interior decorator might license the telephone number 1-800-724-6837, but advertise it as the more memorable phoneword 1-800-PAINTER. In this question, please write a method that finds (and returns) the corresponding digit sequence in a typical cell phone keypad for a given English word. 1) The input English word is a string that is guaranteed to contain lowercase letters only. The input string could be an empty string. 2) The return value of your method should be a string that contains digits only. 3) Your probably need to choose an appropriate data structure to help you solve the problem. This corresponding relationship between digits and letters have been used, mainly in the United States, as a technique for remembering telephone numbers easily. For example, an interior decorator might license the telephone number 1-800-724-6837, but advertise it as the more memorable phoneword 1-800-PAINTER. In this question, please write a method that finds (and returns) the corresponding digit sequence in a typical cell phone keypad for a given English word. 1) The input English word is a string that is guaranteed to contain lowercase letters only. The input string could be an empty string. 2) The return value of your method should be a string that contains digits only. 3) Your probably need to choose an appropriate data structure to help you solve the problem. 4) Your algorithm should have time complexity of O(n), where n is the size of the input string. 5) Please complete only the required method. Do not write a maint) program or any testing code! Example Method Argument Expected Method Return Value "papajohns" "727256467" 1 2. 3 4 5 6 7 8 9 public class Question_13 { /** Finds the corresponding digit sequence in cell phone keypad. @param word: a string containing lowercase letters only @return: the corresponding digit sequence */ public static String digitSequence (String word) { // Please add your code here. } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
