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 d1ca13d commit c31fd65Copy full SHA for c31fd65
README.md
@@ -10,6 +10,8 @@ leetcode 测试
10
11
##### 包含的内容如下
12
13
+https://leetcode.cn/problems/generate-a-string-with-characters-that-have-odd-counts/
14
+
15
https://leetcode.cn/problems/maximum-number-of-groups-entering-a-competition/
16
17
https://leetcode.cn/problems/largest-component-size-by-common-factor
generate-a-string-with-characters-that-have-odd-counts/index.ts
@@ -0,0 +1,6 @@
1
+export default function generateTheString(n: number): string {
2
+ if (n % 2 === 1) {
3
+ return "a".repeat(n);
4
+ }
5
+ return "a".repeat(n - 1) + "b";
6
+}
0 commit comments