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 most concise version!
The heck is a static int in javascript?
duplicate issue (see @donaldsebleung's issue below)
25 dollars for a ticket?! Outrageous!
Updated random unit tests correcting the order of the expected and actual parameters to the assertion. The tests themselves were otherwise correct even though the output misreported what the test expected and what the test received. Marking resolved.
Thank you. Looking into this.
Edit: The random test has actual and expected arguments swapped: the "Expected" is what your algorithm returned. So, I'm sorry for the confusion and will look into correcting this.
Also, the area numbers employed are 64-bit signed integers and 1783715193 fits in just over 30 bits, and the real expected number 9898996673 comes in just over 33 bits. (Determined by taking log-base-2)
Since the real issue appears to be that I swapped expected & actual parameters to NUnit's assert, the message is incorrect but the result still appears correct. If codewars will permit, I will try to correct the test code AND add code to prevent the possibility of overflow -- neither of which should impact anyone currently with a correct solution.
This comment is hidden because it contains spoiler information about the solution
Some random tests in C# expect negative area values:
Expected: -1783715193
But was: 9898996673
Is this correct? It seems like a bug from overflowing the int datatype.
Could use a bit of refactoring...
Wow this should be the most appropiate answer!
First iterations would have a lot of characters to check for in the text, but the last ones would run much quicker because you are discarding the already checked characters.