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.
did not know about the static block to initilize the elements, not sure if its best practice, but much shorter and cleaner than mine.
This comment is hidden because it contains spoiler information about the solution
Not best practice. What if array2 is empty or not the same size as array1? this solution would crash.
I like this. clever use of the bit-wise operator.
I agree. very nice and simple solution. I thought this would have been mostly quadratic run time.
thanks for the comment.
i think something is still wrong with the Randomtest.
the way i'm doing mine, its telling me that i failed, but the output is right.
RandomTests(ReverseTest)
Log
before:
10011001 10111010
after:
10111010 10011001
✘ arrays first differed at element [2]; expected:<1> but was:<0>
please check. it looks like its not reading the array i'm returning, but instead reading the original array.