We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
OK, so Ruby must be doing magic behind the scenes. I just ran str.to_i(2) where str is a stirng with 500 0s and 1s and it converted it to an enormous integer.
2953109070953703694574893395613555973861585638963464418084069329878799422075142253257662390793178049629115076758106380689593440952317566923506479727030.
Which is way over MAX INT for 64-bit architecture.
I might only assume that Haskell's direct conversion to Int doesn't work the same way as Ruby's to_i method.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →
OK, so Ruby must be doing magic behind the scenes. I just ran
str.to_i(2)
where str is a stirng with 500 0s and 1s and it converted it to an enormous integer.2953109070953703694574893395613555973861585638963464418084069329878799422075142253257662390793178049629115076758106380689593440952317566923506479727030
.Which is way over MAX INT for 64-bit architecture.
I might only assume that Haskell's direct conversion to Int doesn't work the same way as Ruby's
to_i
method.