Ad
  • Custom User Avatar

    May depend on what version of Python you're using. 2.x and 3.x treat division and floats very differently. Look into floor division if you're using the latter.

  • Custom User Avatar

    I wrote my solution in C++. I also worked with the length as an odd number first and had a similar issue. When I switched everything, and checked for even lengths first, it seemed to solve the issue. Hope this helps.