Ad
  • 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

    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
    1. I wasn't sure if the argument would be a string that I'd need to split or an array of strings.
    2. Are we sorting after getting the lower case string or the upper case string? (someone else already mentioned this)

    So, the problem statement could be written more precisely in at least a couple of ways and not rely so much on two examples. But maybe that's how things are here. I'm new. This isn't the worst one I've seen. The problem descriptions often make these harder than they actually are.

  • Custom User Avatar

    The problem description really needs work.

  • 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

  • Loading more items...