Ad
  • Custom User Avatar
  • Custom User Avatar

    Double think about this part:

       while(temp < size)
        {
            temp = temp+i;
    

    Let's assume: size = 4, temp =3 , i =2
    If it's still not clear, add cout to the part where you build res.

  • Default User Avatar

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

  • Custom User Avatar

    Add inside your if statement :

    cout<< "adding:" <<msg[count] << " for i=" << i<< endl;
    

    And it should be clear for you why it doesn't work.

  • Custom User Avatar

    68 warriors have solved it already in C++. The issue is in your solution most probably and not in my kata.
    Maybe there is i.e. an additional character not visible in your final string at the end.
    I don't know your solution and I am not able to help you with it. Investigate your code again. You can post it here marked as a spoiler. Maybe somebody can investigate it for you.

  • Default User Avatar

    I get failure codes like this:

    Should work for 100 random strings of 1000 length:
    Expected: equal to Chp0Ht75AqBK8lDXY5bMkz
    Actual: Chp0Ht75AqBK8lDXY5bMkz

    Should work for 100 random strings of 10000 length:
    Expected: equal to kVhRVLx4Ggtp1PLnPMUY84VDhkKG8oGq27LzjUWLuDjcl3WHySV4uk2s2c8EQKP1Kw2J8z
    Actual: kVhRVLx4Ggtp1PLnPMUY84VDhkKG8oGq27LzjUWLuDjcl3WHySV4uk2s2c8EQKP1Kw2J8z

    etc.

    They are exactly the same, but i get the error anyway.

  • Default User Avatar

    I passed all tests, but i got an Exit Code: 139, so i can´t submit the code. Does anybody know what this means?

    Code is in C++.