Ad
  • Default User Avatar

    Your code doesn't return -1 when bounce is 1

    If bounce is 1 and h is greater than window, it will always be greater than window so the loop runs forever.

  • Custom User Avatar

    I don't see it either, but since the code uses the nonstandard function strrev(), it's automatically non-portable even without plusDot().

  • Default User Avatar

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

  • Custom User Avatar

    The thing is that the width specifiers don't dictate the particular argument length, but only maximum.
    So the string with exact same length can have value that doesn't fit the pattern but will be accepted if we remove this check.

  • Custom User Avatar

    it is used to catch any extra trailing characters, then sscanf would return 8, and not 7, therefore when it returns exactly 7 we are sure that we don't have any trailing characters.