Przeglądaj źródła

New problem

master
Lachlan Jacob 5 lat temu
rodzic
commit
c1dd1e4afe
3 zmienionych plików z 16 dodań i 0 usunięć
  1. 10
    0
      1374/main.py
  2. 3
    0
      1374/problem.txt
  3. 3
    0
      1374/run.sh

+ 10
- 0
1374/main.py Wyświetl plik

@@ -0,0 +1,10 @@
class Solution:
def generateTheString(self, n: int) -> str:
if n % 2 == 0:
return ('a' * (n -1)) + 'b'
else:
return 'a' * n

s = Solution()
print("Expected: 'aaab'")
print("Got:", s.generateTheString(4))

+ 3
- 0
1374/problem.txt Wyświetl plik

@@ -0,0 +1,3 @@
Given an integer n, return a string with n characters such that each character in such string occurs an odd number of times.

The returned string must contain only lowercase English letters. If there are multiples valid strings, return any of them.

+ 3
- 0
1374/run.sh Wyświetl plik

@@ -0,0 +1,3 @@
#!/bin/bash

python3 main.py

Ładowanie…
Anuluj
Zapisz