Skip to content

Practice Thousand Separator

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#1556
LeetCode Problem

Thousand Separator

Problem Statement

Given an integer n, add a dot (".") as the thousands separator and return it in string format.

Source: Thousand Separator on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
n = 987
Output
"987"

# Example 2

Input
n = 1234
Output
"1.234"

Constraints

0 <= n <= 2^31 - 1

Related LeetCode Problems

Practice more problems similar to Thousand Separator.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.