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.
Thanks!
this iterates the list, searching, for each list element, making it O(n^2). Since the list is guaranteed to be sorted, you don't have to search, since the consecutive numbers will occur consecutively in the list.
woah, jason!! You finished multiple days early?
sure enough. I hadn't even noticed, since I jumped to the math solution. Given the size of that test, I don't think it's possible to write code to find the answer if the order is arbitrary (that's the main difference between your commented code and the math approach)
Not if it doesnt pass all tests :( it failed the large tests due to timeouts :)
you know... You can submit multiple solutions instead of leaving it as a comment 😂
also, integer has .even? and .odd?
it was to do the " and " instead of ", " prior to the last segment of the formatted result
javascript array reduce can provide the index and the array (so you can know whether you are on the last one). this is a HACK to man-handle ruby. I didn't like it, but I am trying to learn how to do FP in ruby come hell or high water ;)
I guess I could have done the replace-the-last-comma-with-" and" HACK (but both are equally HACKs)
Why do you need the reverses?
maybe not!
I could break your code r = "123 S OH 43235 Street Columbus OH 43221", zipcode = "OH 43235"
you can name regex groups?!?!?!?!
is the ternary check on the last line necessary?
weird.... haha I want to hear how you came up with this.
Why is the Math.log necessary?
Loading more items...