Array Fight
CodeChefOpen on judge ↗
Kapil is nowadays becoming more passionate about programming and today he is exploring array and he is stucked in a problem and the problem is - You are given an array of $n$ element you have to replace all elements of the array with same $number$ and the number by which you are replacing should be in the array and you have to calculate the number of operations requried to convert the array equal
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