"Simplicity can't be bought later, it must be earned from the start" -- DB
public class Solution { public string GenerateTheString(int n) => new string('a', n - (n%2 ^ 1)) + new string('b', 1 - n%2); }
No comments:
Post a Comment