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.

  • 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.