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.
Could you explain why it has polynomial time complexity and not quadratic O(n^2)?
actually, #digit and #sum are two different methods, chained together. one of the beautiful things about Ruby!
i never knew of this #digit method, this is awesome!
This code is based on metaprogramming in Ruby. Function define_method creates methods by itself. It works a bit like #define in C++.
https://apidock.com/ruby/Module/define_method
very clever!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Maybe its been updated since your comment but the description does mention the arrays will be the same length.
smooth code, amazing!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Great solution, but seems like everyone assumed the arrays would be the same length, even though it was never stated. Unfortunately there is no test case for it.
This comment is hidden because it contains spoiler information about the solution
You are mistaken. There is no such condition on their length been equal. As long as array B has all the powers of array A, it is a valid array.
Loading more items...