← All problemsSign in

Find Outside Array

CodeChefRating 1405Open on judge ↗

You are given an array $A$ of size $N$. You want to find an integer that is not present in the array $A$. Unfortunately, you only know addition of $2$ numbers. So you will try to find an integer of the form $X = A_i + A_j$ ($1 \le i, j \le N$), such that $X$ does not appear in the array $A$. If it is possible to find such an integer, print $A_i$ and $A_j$. Here, $A_i$ may be equal to $A_j$, and

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