
You are given:
password
.
N
string fragments
fragments[0..N-1]
(fragments may repeat).
Count the number of ordered pairs of distinct indices (i, j) such that:
fragments[i] + fragments[j] == password
Notes:
(i, j)
and
(j, i)
are counted separately when both satisfy the condition.
i != j
).
Input: password, fragments.
Output: an integer count (potentially large; specify/assume 64-bit).
State any constraints you assume and handle duplicates correctly.