hardMath / GeometryIndian domain~40 min
Rupee Amount To Words
An invoicing system must print cheque amounts in words using the Indian numbering system — thousand, lakh, crore — so '1234567' renders as 'Twelve Lakh Thirty Four Thousand Five Hundred Sixty Seven'.
Problem
Given a non-negative integer amount, return its English representation using the Indian numbering system: the lowest three digits form the hundreds group, then digits are grouped in pairs as thousand, lakh, and crore. Return 'Zero' for 0.
Input
An integer amount (0 ≤ amount ≤ 2,147,483,647).
Output
A string of the amount in words (single spaces, title-cased words).
Constraints
- 0 ≤ amount ≤ 2^31 − 1
- Use Indian grouping: thousand, lakh (10^5), crore (10^7)
- No trailing or leading spaces; 'Zero' for 0
Examples
Example 1
Input
amount = 1234567
Output
"Twelve Lakh Thirty Four Thousand Five Hundred Sixty Seven"
Grouped as 12 | 34 | 5 67 → lakh, thousand, hundreds.
Example 2
Input
amount = 50
Output
"Fifty"
Below one hundred, just the tens word.