- Amazon, Backtracking, Hash, interview-preparation, Mathematical, Strings

Convert a Mobile Numeric Keypad sequence to equivalent sentence

import java.io.*;import java.lang.*;import java.util.*;public class GFG {                static void printSentence(String S)    {                String nums[]            = { “”,    “”,    “ABC”,  “DEF”, “GHI”,                “JKL”, “MNO”, “PQRS”, “TUV”, “WXYZ” };        char str[] = S.toCharArray();                int i = 0;        while (i < str.length) {                                                if (str[i] == '.') {                i++;                continue;            }                                    int count = 0;                                    while (i + 1 < str.length                   && str[i] == str[i + 1]) {                                                if (count == 2                    && ((str[i] >= ‘2’ && str[i]