← All problemsSign in

Sum Of Powers

You are given a string $A$ consisting of only ‘1’s and ‘0’s. The length of the string is $N$. This string is a binary representation of a number $D$. Now, your task is to represent the number $D$ in the following form : D = 2$x$ + 2$y$ + 2$z$ ,where $x$,$y$,$z$ are non-negative integers. If $D$ can be represented in the above form then print “YES” , otherwise print “NO”. Here, the input string $A$

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