4 kyu
parseInt() reloaded
6,153 of 18,586BattleRattle
Description:
In this kata we want to convert a string into an integer. The strings simply represent the numbers in words.
Examples:
- "one" => 1
- "twenty" => 20
- "two hundred forty-six" => 246
- "seven hundred eighty-three thousand nine hundred and nineteen" => 783919
Additional Notes:
- The minimum number is "zero" (inclusively)
- The maximum number, which must be supported is 1 million (inclusively)
- The "and" in e.g. "one hundred and twenty-four" is optional, in some cases it's present and in others it's not
- All tested numbers are valid, you don't need to validate them
Parsing
Strings
Algorithms
Similar Kata:
Stats:
Created | Oct 14, 2013 |
Published | Oct 15, 2013 |
Warriors Trained | 70721 |
Total Skips | 16212 |
Total Code Submissions | 257785 |
Total Times Completed | 18586 |
JavaScript Completions | 6153 |
CoffeeScript Completions | 28 |
Python Completions | 7110 |
Java Completions | 2032 |
Ruby Completions | 348 |
C++ Completions | 1201 |
C Completions | 438 |
NASM Completions | 7 |
Forth Completions | 5 |
C# Completions | 1314 |
Haskell Completions | 149 |
Total Stars | 2381 |
% of votes with a positive feedback rating | 93% of 1910 |
Total "Very Satisfied" Votes | 1667 |
Total "Somewhat Satisfied" Votes | 203 |
Total "Not Satisfied" Votes | 40 |