Ad
  • Default User Avatar

    Figured it out using some tests from the harder version of the this problem.

  • Custom User Avatar

    Right now on the python version I am passing 36 tests and failing 24. All the failing tests are the randomly generated ones. Like:

    1498152621787493509656129759259203897865598852423L should equal 5846006549323611672814739330865132078623730171903L.

    Could someone give me some random test cases that would result in numbers like that so I can find my issue? I seem to somewhat consistently be off by a factor of 3.9 for these, but I pass the regular tests just fine.

  • Default User Avatar

    Got it finally, I cast to unsigned char instead of char like ZajkoUsko recommended.

  • Default User Avatar

    This solved it for me! Thank you so much!

  • Default User Avatar

    Some languages have signed bytes and some don't, a negative byte is just a byte with a value from 128 to 255 when unsigned. Add 2^8 to it and use it as an integer if your language doesn't have unsigned bytes.

  • Default User Avatar

    So far I am passing 127 tests and failing 1: Random zero strings binary input. Can someone give me some examples of input in this category I might be failing on? I can't see any of the test cases.