The example they give is almost too clean, 'un' + 'iq' = 'uniq', length 4.
Model each string as a 26-bit mask of its characters, then use dynamic programming over subsets to find the maximum total length of concatenated strings with no overlapping bits. The DP state is the union mask, and we transition by adding a string if its mask doesn't intersect the current mask.
Pro tip: Mention that this is essentially a maximum weight independent set on a conflict graph, but the bitmask DP is efficient because the alphabet is small (26 bits). Also, note that strings with duplicate characters can be immediately discarded.
For each string, compute a 26-bit mask of its characters. If a string has duplicate characters, discard it because it can never be part of a valid concatenation.
Let dp[mask] be the maximum total length of a valid concatenation using a subset of strings whose combined character mask is exactly mask. Initialize dp[0] = 0 and all other states to -infinity.
For each string with mask s and length L, for each existing mask m where (m & s) == 0, update dp[m | s] = max(dp[m | s], dp[m] + L). Iterate over all strings and all masks.
The answer is the maximum value in the dp array, which represents the longest valid concatenation.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.