273. Integer to English Words
Description
Pitfall
没啥难度,就是贼恶心。
感觉最佳intuitive的solution是用一个stack倒着存一遍,然后再用StringBuilder
来组成final String
thousandIndex
无论发生什么都得++- 优先处理
num = 0
的各种情况num = 0
需要为Zero
lastTwo = 0
需要为""
String getThousand(int curThree)
returns""
when no actual value; otherwise, the actual value.- during the implementation, try to handle the
0
first. - Inserting a prefixed space when there is a value
- during the implementation, try to handle the