JuniorString

Generate a String With Characters That Have Odd Counts

Given an integer n, return a string with n characters such that each character in that string occurs an odd number of times.

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

Example 1
Inputn = 4
Output"pppz"
"pppz" is valid because p occurs three times and z occurs once, both odd counts.
Example 2
Inputn = 2
Output"xy"
"xy" is valid because both x and y occur once, which is odd.

Constraints

  • 1 <= n <= 500

Asked at 1 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate