P19045 [GeeksforGeeks] Number to words0335
普及
题目描述

Write a function to convert a given number into words.
Example 1:
Input:
N = 438237764
Output: forty three crore eighty two lakh
thirty seven thousand seven hundred and
sixty four

Example 2:
Input:
N = 1000
Output: one thousand
Your Task:
You don't need to read input or print anything. Your task is to complete the function convertToWords() which takes the integer n as input parameters and returns a string containing n in words.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ N ≤ 10^{9} - 1

输入格式

见题面

输出格式

见题面

样例输入
N = 438237764
样例输出
forty three crore eighty two lakh thirty seven thousand seven hundred and sixty four