Ad
  • Custom User Avatar

    It's clever for code golf; I can't think of another way to do it with as few characters. And it's not something most people would think to do.

    Production system? Of course not, but that's why the Clever tag was created.

  • Default User Avatar

    The test cases for input are in there. Maybe you just missed it because you implemented it correctly the first time. I spent a very long time on the test cases, and a program that works with the "official" implementation might not work with this implementation as I covered some edge cases that weren't defined explicitly in the language's documentation.

    Anyway, good catch that I didn't include unclean termination in the original description of when to throw an error. Will add that now.

    Edit: and the other error test cases were mentioned in the previous description. I added the unclean termination test case.

  • Custom User Avatar

    I have removed the misleading statement from the problem statement. The question was initially meant to contain at least two points. More test cases were added later.

  • Custom User Avatar

    i also received this error message from one of the tests: "Any empty list of points trivially has all points in a line".
    but the description of the kata states: "The input will contain at least two points containing valid integers."

  • Default User Avatar

    IMO the solution is neither. It could be some sort of best practice if interpreted as 'simple to understand'.
    At most the solution should be O(n log(n)).