My LeetCode grinding. Trying to do a problem a day.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12345678910 |
- 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))
|