← All problemsSign in

Lucky Integers

Given an array **A** of size $n$ filled with elements from [Recamán's sequence](https://en.wikipedia.org/wiki/Recam%C3%A1n%27s_sequence) ; $a_0$ to$a_{n-1}$. Lets define a variable $res$. - Pick any 2 elements from the array, $a_i$ ($0 \leq i \leq n-1$) and $a_j$ ($i-k \leq j \leq i+k$ , provided it exists) such that $a_i ≠ a_j$ and store the product of $a_i$ and $a_j$ into $res$. - Add any

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