← All problemsSign in

Decode The Number

Chef works for a secret agency and he receives a chunk of data from his boss. The data has $N$ pairs of numbers the first number is an integer $X$ and the other number is either $0$ or $1$. Chef has to decode it as follows: - If $X,0$ occurs more times in the code than chef takes the negative of $X$ multiplied by number of times $X,0$ occurred. - While if $X,1$ occurs more times in the code

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