Ad
  • Custom User Avatar

    Note: for this kata y isn't considered a vowel.

    Already specified, follow the instructions.

  • Custom User Avatar

    In English Y is "sometimes" a vowel, which makes this even MORE frustrating!

  • Default User Avatar

    Thank you kindly for these remarks, I'll be sure to keep an eye out for these issues in the future :)

  • Custom User Avatar

    Hi, two quick remarks about your solution.

            int a = 0; //25s in his register
            int b = a; //50s in his register
    

    Consider using variable names that mean something, don't juse use a letter.
    This would prevent two things: having to remember that "a" means "25" and "b" means "100", and having to add those comments to explain your variables.
    If you want to keep the variable names very short for some reason, you could for example have used:

            int n25 = 0;
            int n50 = a;
    

    With a bit more character:

            int numberOf25s = 0;
            int numberOf50s = a;
    

    My second comment is about these two lines at the start:

            if(peopleInLine[0] == 50 || peopleInLine [0] == 100) return "NO";
            if(peopleInLine[1] == 100) return "NO";
    

    I think that those can be classified as "premature optimization".
    You should be able to remove those lines and have the code still work.
    They won't bring much in terms of performance.

    Kind regards,

    Maurice

  • Default User Avatar

    Swift translation kumited. Please review and approve if satisfied.

  • Default User Avatar

    Please fix the specification, vowels are not the same depending on the language used - e.g. while in English Y is not one, in Polish it is. A little more specification would mean a lot less frustration for us users :)