Note: the editorial might not be clear, if anyone has a better explanation of this greedy solution, please comment for me :)
Let the longest prefix of $$$s$$$ consisting only of $$$1$$$s have length $$$k$$$. For every $$$i \le k$$$, since $$$s_i = 1$$$, the prefix $$$t[1..i]$$$ must be a palindrome. This forces all characters in $$$t[1..k]$$$ to be equal.
Now consider positions $$$i \gt k$$$.
Answer for hint4We prove that after the first occurrence of $$$0$$$ in $$$s$$$, there cannot be two consecutive $1$s.
Let $$$k$$$ be the length of the longest prefix of $$$s$$$ consisting only of $$$1$$$s. As shown earlier, this forces $$$t_1 = t_2 = \dots = t_k$$$.
Assume, that there exists an index $$$i \gt k$$$ such that $$$s_i = s_{i+1} = 1$$$.
Since $$$s_i = 1$$$, the prefix $$$t[1..i]$$$ must be a palindrome. However, because there is a $$$0$$$ at some position $$$j \lt i$$$, the prefix $$$t[1..j]$$$ was required to be non-palindromic, and thus $$$t[1..i]$$$ must already contain at least one mismatch.
Now consider $$$s_{i+1} = 1$$$. Then $$$t[1..i+1]$$$ must also be a palindrome.
Observe that when extending a string by one character, a palindrome can only exist if all previously mismatched symmetric pairs are fixed.
Therefore, it is impossible for both $$$t[1..i]$$$ and $$$t[1..i+1]$$$ to be palindromes after the palindrome has been broken earlier. This contradicts the assumption that $$$s_i = s_{i+1} = 1$$$. Hence, after the first $$$0$$$ in $$$s$$$, two consecutive $1$s cannot occur.
Now consider any block of consecutive $$$0$$$s in $$$s$$$ starting at position $$$l \gt k$$$, and let its length be $$$len$$$. For every position $$$i$$$ in this block, the prefix $$$t[1..i]$$$ must NOT be a palindrome. This means that for each such $$$i$$$, there must exist at least one index $$$j \le i$$$ such that $$$t_j \ne t_{i-j+1}$$$.
Since the first $$$k$$$ characters of $$$t$$$ are all equal, the only way to guarantee that the palindrome condition is broken for all $$$i$$$ in this block is to ensure that the mismatch happens within the last $$$k$$$ characters of the prefix. For example:
$$$s = 1110001$$$, $$$t = 1110111$$$
$$$s = 11100001$$$, $$$t = 11100111$$$
$$$s = 11100010001$$$, $$$t = 11101110111$$$
$$$s = 1110000100001$$$, $$$t = 1110011100111$$$
But if $$$s = 11100010001$$$, notice the first $$$0$$$ block has length $$$3$$$ while the second has length $$$4$$$, it is impossible to construct $$$t$$$.
Therefore, all characters assigned in a block of $$$0$$$ s must be equal, otherwise, an earlier mismatch might disappear when the prefix grows, accidentally restoring the palindrome.
Moreover, the length of each block of $$$0$$$s must be at least $$$k$$$. If $$$len \lt k$$$, then when $$$i = l + len - 1$$$, the suffix of length $$$k$$$ of $$$t[1..i]$$$ lies entirely inside the initial prefix $$$t[1..k]$$$, which is constant. Hence, no mismatch exists, and $$$t[1..i]$$$ becomes a palindrome.
Thus, each block of consecutive $$$0$$$s must have length at least $$$k$$$, and all characters inside the block must be equal.