Problem 91. Get the area codes from a list of phone numbers
Solution Stats
Problem Comments
-
6 Comments
An explanation of common notations of area codes would be nice for us non-Americans :)
I (as French) Agree. A Wikipedia link which would explain supported area codes is definitely missing.
"You can assume the first three digits of a ten-digit number will always be the area code." Hmmm.... too bad there was no explanation applying to telephone numbers with more (or less?) than ten digits.
The problem fails to mention that the area codes should be sorted, and that phone numbers may have country codes.
This isn't about American-style phone numbers, but US-style. Otherwise it would be nice to include other test cases so people would be required to actually parse the country code away. Now it is just a matter of removing a leading 1.
Madness of cellfun regexp
Solution Comments
Show commentsProblem Recent Solvers1058
Suggested Problems
-
1202 Solvers
-
1440 Solvers
-
605 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
379 Solvers
-
13991 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!