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

Stats:

CreatedOct 14, 2013
PublishedOct 15, 2013
Warriors Trained70721
Total Skips16212
Total Code Submissions257785
Total Times Completed18586
JavaScript Completions6153
CoffeeScript Completions28
Python Completions7110
Java Completions2032
Ruby Completions348
C++ Completions1201
C Completions438
NASM Completions7
Forth Completions5
C# Completions1314
Haskell Completions149
Total Stars2381
% of votes with a positive feedback rating93% of 1910
Total "Very Satisfied" Votes1667
Total "Somewhat Satisfied" Votes203
Total "Not Satisfied" Votes40
Ad
Contributors
  • BattleRattle Avatar
  • MMMAAANNN Avatar
  • Blind4Basics Avatar
  • nomennescio Avatar
  • KataSideKick Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • uniapi Avatar
  • Paul Robertson Avatar
Ad