IP-Info is a website where you can find out what your IP is as well as your user agent and information about your browser and OS. The site also has tools for looking up information about a particular IP and reverse DNS lookups. There is also a tool where you can check "is this site down" and numerous informative articles.

logic 2

The answer should be 1...10111 = -9.
You never said how many bits there are, so -9 is the only logical answer.
But there is another mistake in your solution: for 62 you used 6 bits while for other values you used only 5 bits so you got 010111 instead of 110111 = 55.
With 6 bits the answer is 55, not 23. With infinite bits, the answer is -9.

Only use exactly enough bits to generate the numbers for each step. You should only acquire leading zeros from operations which negate bits or require additional bits to make the strings the same size.

ynori7 wrote:
Only use exactly enough bits to generate the numbers for each step. You should only acquire leading zeros from operations which negate bits or require additional bits to make the strings the same size.

Sorry, but that doesn't make sense. Either you use an infinite number of bits or you use a fix number of bits.
Since you never said how many bits to use, the first option is the only logical one.
Python also chooses the first option and returns -9 as it should.

About

Valhalla is a place for sharing knowledge and ideas. Users can submit code, as well as science, technology, and engineering-oriented news and articles. We also have an assortment of fun and educational challenges intended to help users learn more about programming, mathematics, encryption, hacking and more.

We also affiliate with other IT-related sites. We provide a biography and tags for each affiliate so users can easily find the content they are interested in.