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.
The final test case fails if the values are sorted. I had to remove SORT from my statement to pass the tests.
Thanks! :)
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?
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. :-)
it does.
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.