Given an&nbsp;integer n, return a string with n&nbsp;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. &nbsp;

&nbsp;
Example 1:

Input: n = 4
Output: "pppz"
Explanation: "pppz" is a valid string since the character 'p' occurs three times and the character 'z' occurs once. Note that there are many other valid strings such as "ohhh" and "love".


Example 2:

Input: n = 2
Output: "xy"
Explanation: "xy" is a valid string since the characters 'x' and 'y' occur once. Note that there are many other valid strings such as "ag" and "ur".


Example 3:

Input: n = 7
Output: "holasss"


&nbsp;
Constraints:


	1 &lt;= n &lt;= 500


class Solution:
    def generateTheString(self, n: int) -> str:
        alpha = "abcdefghijklmnopqrstuvwxyz"
        res=""
        while n>0:
            curr, alpha = alpha[0], alpha[1:]
            if n%2:
                res += curr*n
                n-=n
            else: 
                res += curr*(n-1)
                n-=n-1
        return res
class Solution {
    public String generateTheString(int n) {
        String s = "";
        String string ="a";
        for (int i = 0; i < n-1; i++)
            s += string;
        if(n%2==0)
        return s+"b";
        return s+"a";
    }
}
class Solution {
public:
    string generateTheString(int n) {
        string s="";
        if(n%2!=0){
            for(int i=0;i<n;i++)
                s+="a";
        }
        else{
            for(int i=0;i<n-1;i++)
                s+="a";
            s+="b";
        }
        return s;
    }
};
// C++ Code
class Solution {
public:
    string generateTheString(int n) {
        string res = "";
        if (n%2 == 0)
        {
            res += 'a';
            n -= 1;
        }
        for (int i=0;i < n;i++)
            res += 'k';
        return res;
    }
};


// JavaScript Code
var generateTheString = function(n) {
    let ans = [];
    let state = n % 2 === 0 ? true : false;
    
    if(!state){
        for(let i=0;i<n;i++){
            ans.push('a');
        }
    }else{
        for(let i=0;i<n-1;i++){
            ans.push('a');
        }
        ans.push('k');
    }
   
    return ans.join('');
};
Generate a String With Characters That Have Odd Counts