← All problemsSign in

Pairwise String Sums

Consider the following task: - You are given $N$ non-empty strings $s_1, s_2, \ldots, s_N$. These strings are not necessarily distinct. - Let $L$ be the list of all strings formed by concatenating two of the given strings. More formally, start with an empty list and for each valid ordered pair $(i, j)$ such that $i \neq j$, add the string $s_i+s_j$ ($+$ denotes string concatenation) to this list.

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start