Ad
  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    OP solved it, closing

  • Default User Avatar

    I agree it needs revision, the capital 'W' in the example output ["CodeWars"] made me think there could be mutiple capital letters in each string of the array which apparently isn't true. In cases of arrays containing multiple strings the only capital letters were the first ones of the strings making this problem easier.

  • 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

    added for #1, #2 is already clear (case insensitive), closing ~~

  • Custom User Avatar

    My JS solution passes the Basic Tests and then I get something like:

    expected 'Ashley' to equal 'Charles'

    for the Randoms. I'd appreciate clarification on this output. Thanks.

  • Custom User Avatar

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

  • Custom User Avatar

    The description could benefit from having an example with "triplicates". E.g.,

    // keys
    [ 'x', 'y' ]
    
    // objs
    { x: 1, y: 1 },
    { x: 1, y: 1, w: 1 },
    { x: 2, y: 2 },
    { x: 1, z: 1 },
    { x: 1, y: 1, z: 3 },
    

    How many times should { x: 1, y: 1} be present in the return array? Once? Twice? Clarify that it should be at most once. If there is a "duplicate", { x: 1, y: 1} should be present in the return array at most once. If there are multiple "duplicates", { x: 1, y: 1} should still only be present in the return array once. The same goes for the other "duplicates" in the above example. So the expected result is:

    { x: 1, y: 1 },
    { x: 1, y: 1, w: 1 },
    { x: 1, y: 1, z: 3 },
    

    and not:

    { x: 1, y: 1 },
    { x: 1, y: 1 },
    { x: 1, y: 1, w: 1 },
    { x: 1, y: 1, w: 1 },
    { x: 1, y: 1, z: 3 },
    { x: 1, y: 1, z: 3 },
    
  • Custom User Avatar

    Read the instructions again. 1100 is divisible by 4, but also by 100 and not by 400, then it's not a leap year.

    The instructions are all clear.

    No, they are unnecessarily unclear. You are adding more than the instructions say. The instructions literally say:

    • if the year is evenly divisible by 4, then it is a leap year. (they do not say that if it is not divisible by 4 and not divisible by 400, then it is not a leap year (note; that is true independently of whether the year is divisible by 100)).
    • if the year is evenly divisible by 100, then it is not a leap year. (they do not say that if it is not divisible by 400 but divisible by 100, then it is not a leap year).
    • if the year is evenly divisible by 400, then it is a leap year.

    The converse of a conditional is not logically equivalent to its conditional. If you code what the instructions literally say, you will not get the right answer. But the definition is simple:

    A year is a leap year just in case either it is evenly divisble by 4 but not evenly divisible by 100 or it is evenly divisible by 400.

    Code that, and you'll get the right answer.

  • 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

    Ah, okay. Thanks.

  • Custom User Avatar

    Can't be changed.

  • Custom User Avatar

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

  • Loading more items...