• 21.5%

https://leetcode.com/problems/integer-to-english-words/#/description

Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.

Hint:

1. Did you see a pattern in dividing the number into chunk of words? For example, 123 and 123000.
2. Group the number by thousands (3 digits). You can write a helper function that takes a number less than 1000 and convert just that chunk to words.
3. There are many edge cases. What are some good test cases? Does your code work with input such as 0? Or 1000010? (middle chunk is zero and should not be printed out)

https://discuss.leetcode.com/topic/24112/fairly-clear-4ms-c-solution

Fairly Clear 4ms C++ solution

https://discuss.leetcode.com/topic/22949/c-solution-4ms

C++ solution 4ms

A faster version and maybe easier to understand (4ms):

https://discuss.leetcode.com/topic/22959/short-clean-c-code-with-explanation

Short clean C++ code, with explanation

Function hundredStr() produces a string from integer less than 100.

And in numberToWords() it uses a for loop to set “Thousand”,”Million”,”Billion”.

https://discuss.leetcode.com/topic/23061/recursive-python

Recursive Python

https://discuss.leetcode.com/topic/39814/python-clean-solution

Python Clean Solution

8ms, 26.68%, 17 July 2016

https://discuss.leetcode.com/topic/49124/the-simplest-recursive-solution-ever-yet-efficient-enough-in-c