Spell a Nonnegative Signed Integer in English Words

Quick Overview

Spell a Nonnegative Signed Integer in English Words. Convert num into ordinary English number words using the format illustrated here: capitalized number words separated by single spaces, with Thousand, Million an

Spell a Nonnegative Signed Integer in English Words

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Other

### Problem Convert num into ordinary English number words using the format illustrated here: capitalized number words separated by single spaces, with Thousand, Million and Billion scales and no "and" or hyphens. Zero is "Zero". ```cpp string numberToWords(int num); ``` ### Examples ```text num = 1010 -> "One Thousand Ten" num = 1000001 -> "One Million One" ``` ### Constraints - 0 <= num <= 2147483647.

Overview: Spell a Nonnegative Signed Integer in English Words. Convert num into ordinary English number words using the format illustrated here: capitalized number words separated by single spaces, with Thousand, Million an

Amazon logo
Amazon
Source window: 0–3 months · as of Oct 21, 2026
hardSoftware EngineerOtherCoding & Algorithms
0
0

Problem

Convert num into ordinary English number words using the format illustrated here: capitalized number words separated by single spaces, with Thousand, Million and Billion scales and no "and" or hyphens. Zero is "Zero".

string numberToWords(int num);

Examples

num = 1010 -> "One Thousand Ten"
num = 1000001 -> "One Million One"

Constraints

  • 0 <= num <= 2147483647.