Ad
  • Custom User Avatar

    I prefer it this way to be extra sure. I doubt it would slow it down much

  • Custom User Avatar

    @fran_Cesco: No, that's not the case, read about integer division.

  • Custom User Avatar

    I believe that the test cases have been luckily tailored to allow this solution. 9 mangos that cost 5 each cost 30 in total. But if you apply the above with 8 mangos costing 5 each you should get the same result (you are not taking advantage of 1 free mango) but instead you get a float which makes no sense because the result should always be a multiple of 5.

  • Custom User Avatar
    Why do you put all this things in the same array?
    

    prefixes -> [
    'Mister', 'Mr.',
    'Mr', 'Madame',
    'Mrs.', 'Mrs',
    'Miss', 'Ms.',
    'Ms'
    ]
    suffixes -> [ 'Senior', 'Sr.', 'Sr', 'Junior', 'Jr.', 'Jr' ]

    Like "Junior" and "Jr". Must be to a map from what may be translated and the final word and no all the thing together.

    If you submmit a pull request this way your partners of the team will say bad things of you...

  • Custom User Avatar
    given John Dallas junior-> J. Dallas Jr
    expected 'J. D. Junior' to equal 'J. Dallas Jr'
    

    It's not mentioned anywhere that prefix/suffix checking should be case-insensitive.

  • Custom User Avatar

    Random tests:

    given Mrs. Mohammad Eugenia Carlos McLaughlin Sr -> Mrs M. E. C. McLaughlin Sr
    expected 'Mrs M. E. C. Mclaughlin Sr' to equal 'Mrs M. E. C. McLaughlin Sr'
    
    given Santino Marlen Hosea O'Hara Jr -> S. M. H. O'Hara Jr
    expected 'S. M. H. O\'hara Jr' to equal 'S. M. H. O\'Hara Jr'
    

    It is unclear how the spec Every element of the returning string should be capitalized should be interpreted with name parts containing multiple uppercase letters.

    And in the end, no matter what the expected behaviour is, it should be in the fixed tests to make sure it's tested. Sometimes it does not appear in the random tests.

  • Custom User Avatar

    Prefix + First Name + Last Name + Suffix

    the string can include more than one First Name

    These two statements in description contradict with each other. It should be "one or more First Name(s)".

  • Custom User Avatar

    Preloaded prefixes and suffixes are arrays like this:

    [ 'Mister', 'Mr.', 'Mr', 'Madame', 'Mrs.', 'Mrs', 'Miss', 'Ms.', 'Ms' ]
    

    How are we supposed to comprehend this data structure? When I see Mister I do not know what it's supposed to map to, unless I refer to the expected result or the description. (Or in other words, these preloaded arrays are pretty useless.)

  • 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

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

  • Custom User Avatar
  • Custom User Avatar

    People often use them where they shouldn't, unless it's a callback.
    But this is more my preference

  • Custom User Avatar

    It is strange to hate arrow functions... It is just type of function

  • Custom User Avatar

    I hate arrow functions, that's why I wrote it as supposed to!!!

  • Loading more items...