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.
I think for time complexity you always have to consider worst case scenario, so in this case short circuiting would help practically, but for calculating time complexity I don't think it does.
also, integer has .even? and .odd?
without giving it all away, you can learn a lot about the math of this by substituting i in in each of the equations, to make them in terms solely of n.
you can name regex groups?!?!?!?!
This comment is hidden because it contains spoiler information about the solution
What's with extra % 2? Was there a reason behind it?
pretty close to mine!