Contents

Problem Information

Problem Name: 487-3279
Problem Number on PKU: 1002
Synopsis: Converting various alpha-numeric telephone numbers to a standard form. Alphabets are mapped to digits from 1-9 with the exception of Q and Z. Then, only the duplicate numbers with more than 2 entries are displayed, followed by a frequency, in the order of increasing lexicographical order. Otherwise, the program should display "No duplicates."

Solver Information

Solver: Eric Hong
Date: February 05, 2008

General Strategy

Using Scanner, take the input.

Using switch() statement for each char, convert the alpha-numerals to numbers, ignoring all other characters.

After 3 iterations, insert a dash.

Store each number in Hashtable<String, Integer> with the number as a key and the frequency as a value.

Enumerate entries of Hashtable to Vector.

Sort them lexicographically using Collections.sort().

Using foreach loop, display the numbers with frequency greater than or equal to 2.