LeetCode --- 1374. Generate a String With Characters That Have Odd Counts 解题报告

Posted 杨鑫newlfe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1374. Generate a String With Characters That Have Odd Counts 解题报告相关的知识,希望对你有一定的参考价值。

Given an integer nreturn a string with n 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.  

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 

以上是关于LeetCode --- 1374. Generate a String With Characters That Have Odd Counts 解题报告的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串

LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串

LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串

LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串

LeetCode --- 1374. Generate a String With Characters That Have Odd Counts 解题报告

LeetCode | 1374. Generate a String With Characters That Have Odd Counts生成每种字符都是奇数个的字符串Python