|
|
вернуться в форумA closer look! Each number maps to several letters of the alphabet. However, notice that several letters map to a single digit. If you can't go to the mountain, bring the mountain to you. Convert the words found in the dictionary for each case into digits, using the given map. Looking up which digit a letter maps to can be done in constant time if you use the right data structure. Then all that is left is to compare against the phone number given. Re: A closer look! Послано shako 13 июл 2009 13:26 Each number maps to several letters of the alphabet. However, notice that several letters map to a single digit. If you can't go to the mountain, bring the mountain to you. Convert the words found in the dictionary for each case into digits, using the given map. Looking up which digit a letter maps to can be done in constant time if you use the right data structure. Then all that is left is to compare against the phone number given. Re: A closer look! Wow smart! Re: A closer look! Послано BillSu 17 апр 2014 13:40 Clever tips. Thanks. Re: A closer look! Great Tip. Re: A closer look! Can't believe!!!! Excellent idea!!!! Re: A closer look! If you can't go to the mountain, bring the mountain to you....wow what a statement! Re: A closer look! nice, but you must check such events: 1) word contains "ij" -> "11"(simple going letter by letter algorythm), that is not right it must transform into "1"( in dict "1":"ij"), but if word contains "ii" it must transform into "11". 2) if one word ends on some digit and another starts on it. we have words with "18" code and "89" code. Number "189". It depends, what letters words contain. There three alternatives: take both words, take with "18" or with "89". |
|
|