Ad
  • Custom User Avatar

    You should avoid the use of the ctype.h header and its functions like tolower. The behavior of these functions can change based on locale. It's not an issue here since the tests run on the server with the same locale, but it's a problem when running code on other computers. You can either change the locale using setlocale, or write your own tolower.

  • Custom User Avatar

    Subtracting a size_t from a size_t is not well-defined when the result is negative. You should compare them first to ensure that the result is positive before subtracting them. Also, the use of the ternary operator here is just not necessary.