Ad
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    you cannot call strlen() on something like

    char vowels[] = {'a','e','i','o','u'};
    

    This is a char array, not a null-terminated string. strlen() works by iterating through the string until it finds a nul byte ('\0'). vowels does not contain one, so it will keep scanning the memory until a nul byte happens to be there by chance. this is undefined behavior and should be avoided at all costs. In the sample tests you are just being lucky.

    Also, performance note: you should almost never call strlen() in a loop on the same string: this makes your program slower for no reason; because unless the string's length is modified during the loop, strlen() will keep doing the exact same operation again and again and return the same result every time

  • Custom User Avatar

    can you show (with a spoiler flag and proper markdown formatting) the code that should pass, according to you ?

    note that SELECT a, b is different from SELECT b, a; this has nothing to do with the fact that clauses like FROM, WHERE, ... can usually be written in any order

    i'm closing as you do not provide enough information for this to be an issue. feel free to answer with your code if you want an explanation though

  • Custom User Avatar

    I wrote 1st solution in PostgreSQL, but I didn't pass last test. Then, I select rows in original order and I pass it. I thought line order doesn't matter in SQL. It's most common behavior.