Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try to build the string with a backtracking DFS by considering what you can put in every position.
Solve with full IDE support and test cases