Ad
  • Custom User Avatar

    The testcases actually contain such example: 36288000 can be represented both as "99900000000" and "A0000000000". Only one of the solutions is considered correct though...

  • Custom User Avatar

    you are using the C++ std::string, working with strings in c11 is a bit more painful since you can only have a null terminated char array
    https://www.tutorialspoint.com/cprogramming/c_strings.htm

    the example at the link above shows how to work with static char arrays but if you need a string of a dynamic length, of course the array can also be a dynamic one (obtained through malloc/calloc/realloc)

    you can no longer use str += 'x', instead use str[len++] = 'x'; str[len] = '\0';