Ad
  • Default User Avatar

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

  • Custom User Avatar

    You are correct that this solution would throw an exception if an id was passed in that was not a valid planet id (like 13, since there are not 13 planets), but the description does not state what should happen in such a case and there are no test cases for such a case that I am seeing. It may be considered good practice to throw a clearer exception with a message stating what is wrong instead of just letting C# throw an out of bounds error for me, but I tend to prefer shorter solutions and definitely think throwing an exception for invalid inputs is generally appropriate.

  • Default User Avatar

    am i forgetting things here? i was thinking that return could give you and error if the id was bigger than the
    size of the array.
    Or there is something im not seeing here?

  • Default User Avatar

    clever as clever can get