Ad
  • Custom User Avatar

    A couple of things...

    1. If someone needs to include the data frame in their solution, it should be included in the solution setup. The Details page says,

    The following data.frame of US presidents from Kennedy through Trump is preloaded for you and is used in the testing.
    but I received errors when testing my solution until I included the data frame myself.

    1. In R it is almost never to return NULL. If you want the coder to reutrn "nothing", far better is character(0) so the return type is consistent for all cases. But, R has something very few other languages have, the ability to represent "unknown" values with NA. Either of these would be more appropriate for the language than NULL. In this, specific, context, I think NA would be most appropriate for any date after April 30, 1789 since there is a US President for all of those dates (presumably into the future as well) even if we don't know who it is, and character(0) for any dates before that since there was no US President before that date.

    2. As far as the problem goes,

    or is more than 8 years after the last inauguration

    should be,

    or is more than 8 4 years after the last inauguration

    Since US Presidents are elected for 4 year terms.

  • Custom User Avatar

    No random tests.