package leetcode;

/**
 * https://leetcode.com/problems/generate-a-string-with-characters-that-have-odd-counts/
 */
public class Problem1374 {
    public String generateTheString(int n) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1374 prob = new Problem1374();
        System.out.println(prob.generateTheString(4)); // "pppz"
        System.out.println(prob.generateTheString(2)); // "xy"
        System.out.println(prob.generateTheString(7)); // "holasss"
    }
}

@@ -193,330 +193,308 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1374 prob = new Problem1374();%0A        System.out.println(prob.generateTheString(4)); // %22pppz%22%0A        System.out.println(prob.generateTheString(2)); // %22xy%22%0A        System.out.println(prob.generateTheString(7)); // %22holasss%22
+String answer = %22%22;%0A        if (n %25 2 == 0) %7B%0A            for (int i = 0; i %3C n - 1; i++) %7B%0A                answer += %22a%22;%0A            %7D%0A            answer += %22b%22;%0A        %7D else %7B%0A            for (int i = 0; i %3C n; i++) %7B%0A                answer += %22a%22;%0A            %7D%0A        %7D%0A        return answer;
 %0A   

Solve problem 1374