Back to problems

Pair Concatenation to Target

Algorithm · Capital One · Medium

Requirements You receive a non-negative integer array numbers together with an integer target. Compute how many ordered index pairs (i, j) satisfy i != j and str(numbers[i]) + str(numbers[j]) == str(target). Direction matters: (i, j) and (j, i) must be treated as separate pairs. Equal values located at separate positions each contribute independently. target may contain roughly 10 digits, while numbers may hold as many as roughly 10^5 entries; an $$O(n^{2})$$ brute-force…

Checking your access…