leetcode - 1374 Generate a String With Characters That Have Odd Counts Solution w/ Explanation

Опубликовано: 22 Май 2026
на канале: litCode
335
3

like and subscribe!

Given an integer n, return 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.

0:05 Problem Overview
2:20 Solution 1 - Easy to Understand
6:16 Solution 2 - Shortened
7:40 Solution 3 - Using Arrays