Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Great kata! A lot of fun figuring out several differnt ways to optimize, and more fun debugging the optimizations. :-)
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.
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.