We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba2849b commit 4fc8190Copy full SHA for 4fc8190
README.md
@@ -10,6 +10,8 @@ leetcode 测试
10
11
##### 包含的内容如下
12
13
+https://leetcode.cn/problems/thousand-separator/
14
+
15
https://leetcode.cn/problems/count-odd-numbers-in-an-interval-range/
16
17
https://leetcode.cn/problems/shuffle-string/
thousand-separator/index.ts
@@ -0,0 +1,6 @@
1
+export default function thousandSeparator(n: number): string {
2
+ const str = [...n.toString()].reverse();
3
+ return Array(Math.ceil(str.length / 3)).fill(0).map((_, i) =>
4
+ str.slice(i * 3, i * 3 + 3).reverse().join("")
5
+ ).reverse().join(".");
6
+}
0 commit comments