← All problemsSign in

Chef and Coding

Chef loves competitive coding. He has a friend Vasya who also loves competitive coding. One day, Vasya gave a challenge to chef. Chef tried hard but couldn't get any idea so chef asked you to solve this challenge. Can you help Chef to solve the challenge? In the challenge,you will be given array $A$ and must determine an array $B$ such that for all $i$, either $B[i] = A[i]$ or $B[i] = 0$. Your t

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