Ad
  • Custom User Avatar

    The final test case fails if the values are sorted. I had to remove SORT from my statement to pass the tests.

  • Default User Avatar

    Thanks! :)

  • Default User Avatar

    Hmmm not sure.

    If the time is the same for all languages, then to pass these kata, we may as well all use the fastest one - for the kata at hand.

    Either that, or the time needs to be adjusted for each language.

    But I see this kata has been solved in Python? Is that correct?

  • Default User Avatar

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

  • Default User Avatar

    Great kata! A lot of fun figuring out several differnt ways to optimize, and more fun debugging the optimizations. :-)

  • Custom User Avatar
  • Default User Avatar

    Instructions should say the count column should be labled 'total_people'.
    Also, I think it would be better to specify an order by. Shouldn't rely on SQL always returning the same row order for an unordered query.

  • Default User Avatar

    My solution uses this "winding" technique. Imagine standing at the point in question. Face the first vertex, then turn to face each of the other vertexes in sequence, and finally back to the first vertex. If you made a net 360 degree turn, you're inside. If you're outside the net turn is zero. BTW, I never heard of "winding number" when I came up with this solution.

    I also thought of counting intersections on lines from the point to each vertex with each line of the polygon but that seemed harder, and I think it would be slower.