Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 1902. GJam 2014 China Rd A: Read Phone Number (Large)

Created by Richard Zapor

This Challenge is derived from GJam 2014 China Read Phone Number. Large 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. The > 10 repeats occurs in the Large Data set.

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


[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 Time of 12 minutes with 1094 of 3058 able to process the Large data set.


Problem Group

Solution Statistics

2 correct solutions 3 incorrect solutions
Last solution submitted on Apr 21, 2014

Solution Comments