Problem 1901. GJam 2014 China Rd A: Read Phone Number
This Challenge is derived from GJam 2014 China Read Phone Number. Small Case.
The Goal is to output a string for the reading of a segmented phone number. When numbers are replicated within a segment the number is preceded by its multiplier. If there are more than 10 repeats in a segment then the number is output for the number of occurrences. Count multipliers are double, triple, quadruple, quintuple, sextuple, septuple, octuple, nonuple, and decuple for 2 thru 10, respectively.
Input: [Number, Segments] where Number is a string and segments is a Vector that sums to the length of Number
Output: Text, a string of the reading based upon segments
Examples:
[Number,Segments] [Text] ['15012233444', [3 4 4]] ['one five zero one double two three three triple four'] ['15012233444', [3 3 5]] ['one five zero one double two double three triple four']
Contest Performance: Best Delta Time of 11 minutes with 1885 of 3058 able to process the small data set.
Solution Stats
Problem Comments
-
1 Comment
Whatever happened to 8675309???
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
1880 Solvers
-
Back to basics 12 - Input Arguments
599 Solvers
-
Flag largest magnitude swings as they occur
679 Solvers
-
Basics: 'Find the eigenvalues of given matrix
418 Solvers
-
Given a matrix, return the last eigen value
223 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!