Class Solution

java.lang.Object
g1501_1600.s1556_thousand_separator.Solution

public class Solution extends Object
1556 - Thousand Separator.<p>Easy</p> <p>Given an integer <code>n</code>, add a dot (&ldquo;.&rdquo;) as the thousands separator and return it in string format.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> n = 987</p> <p><strong>Output:</strong> &ldquo;987&rdquo;</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> n = 1234</p> <p><strong>Output:</strong> &ldquo;1.234&rdquo;</p> <p><strong>Constraints:</strong></p> <ul> <li><code>0 <= n <= 2<sup>31</sup> - 1</code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • thousandSeparator

      public String thousandSeparator(int n)