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.
isnt sort supposed to be time consuming? instead of just a single pass you are doing an nlogn operation just for sorting
Unusual feature request: Sell Codewars t-shirts! I would buy several for my students and me. (Sorry if this is inappropriate for this forum. I couldn't figure out where else to post it.)
The more I work in the dynamic languages here, the more I think we need a 'efficient' vote as well as best practices and clever. While best practices and cleverness are good, I see too many answers that are O(n^2) solutions for questions that have a very clear O(n) solution that are voted to the top because they are a single line and use some cool language features.
I think these answers are great and they show you some really neat aspects of certain languages but they are not solutions that would be production ready and often overshadow the most efficient solutions
Is there any request for a efficent voting mechanism? I would love that.
All? short circuts.
You should stop once you witness failure of monotonicity, e.g. don't traverse the whole array if heights[0] > heights[1]. That way your average complexity will be even better than linear.
More stats. How long did I take to solve it? Avereage solve time. A kata breakdown(how I earned what, it seems I randomly got 40 kata). What languages do I spend the most time solving? What langauges do I spend the least time? Change in leadership position over time. Any more tracking would be cool to look at.
It doesn't provide a way to submit tests though. You need to submit a solution and see that output.
Also the user documentation seems out of date (the returned output does not match what they say should be returned) so it is resonable to assume the rest could be out of date.
No test cases with words with apostrophe.
Comparing an array like that would be n, linear.
Absolutely, you don't happen to know the Big O time for comparing do you?
I really like this solution, your process_items is very clean and short. I'm curious why you decided to use two lists instead of a hash though? Also, don't you need to reset your @identify to proc {|obj| obj} in your reset? Otherwise you would be using the identify from the previous batch job.
Regex usually isn't the best for readability but it's a lot cleaner than how I removed the _ and =. I'm new to ruby so bare with me when I ask, are ternary operators prefered? I see them everywhere in the solutions but I've never liked the way read vs a regular if else.
Haha yeah, ruby has a lot of hidden gems(tee hee) in the collections docs
Nice. Your solution uses methods I wasn't familiar with (total beginner)
Loading more items...