Amazon Interview Question

Words representation of number.

Interview Answer

Anonymous

Jan 21, 2012

Use String array for single, teens, tens number and units place. For each two number from right write function to written its word representation. Just go on appending it to result stringbuilder and if negative append negative word, reverse words first and then the whole result string.