Odd Repeat
Chef has an array consisting of $N + K - 1$ integers. The array contains only the first $N$ **positive odd numbers**. Each number appears **exactly once**, except for one number which appears **exactly $K$ times**. The sum of integers in Chef's array is equal to $S$. For example, for $N = 3$, $K = 2$, the possible arrays could be $[1, 1, 3, 5]$, $[3, 1, 3, 5]$, $[5, 3, 5, 1]$. For $N = 1$, $K = 3
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.
Sign in to chat with the tutor and save your progress.
Sign in to start