Ad
  • Default User Avatar

    Thank you, I finally got it! My mistake was that I iterated i from 1 to s1.length and therefore the 0th character of s3 (that after reversion became the last) was skipped.
    I had tried running it in VS, but VS doesn't show this "null-character". I found it via an online compiler.

  • Default User Avatar

    Wait, it is claimed that The input should consist only of binary digits - no spaces, other digits, alphanumeric characters, etc.
    But in the next string the last example for JS ismultipleof3Regex.test(' abc ') should be false.

    But ' abc ' can NOT be input, because it contradicts the condition, can it?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    If it matters, I get a inverted string and to reverse it I use string(s.rbegin(), s.rend() and reverse(s.begin(), s.end(). Neither works.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution