Identify the perfect square in the string
<p>A perfect square is taken in binary and some bits are replaced with "?" for example 1??, the number would be 4.(or 1????000???0000)</p>

<p>I need to find that perfect square.(there will be only such possible number)</p>

<p>number of '?'s in the string be n</p>

<p>To find that number what I am doing is iterating through 2**n numbers(111,110,101,100) and checking if it is a perfect square. I am using following function to check if it is a perfect square.</p>

<pre><code>bool issqr(int n){
   int d=(int)(sqrt(n));
   if(d*d==n) return true;
   else return false;
}
</code></pre>

<p>Even though in python I did it, it is taking a lot of time, so I shifted to C++ using only bit operations for populating 2**n numbers(which was much faster than the python version)</p>

<p>but this fails if the number has more than 64 bits</p>

<p>How to avoid this problem? How can I do the same thing if a number has say 120 bits.</p>

<p>(10100110???1?1?01?1?011000?1100?00101000?1?11001101100110001010111?0?1??0110?110?01?1100?1?0110?1?10111?01?0111000?10??101?01)</p>
