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.
What a flex!
I mean that is the main purpose of zip, isn't?
My solution is just flat-out embarsassing compared to everyone else's.
I think I have the solution. My local fork accepts your current code and tests.
It would help if you wrote code and tests, for specifically what you want to do, that currently fails, because I'm losing sight of things a bit, with umpteen possibilities to choose from, some of which already work.
Seems arbitrary. Self-comparison plays a role in symmetry for odd-length arrays. You still have even-length left for your symmetry driving needs
Single-element arrays are treated as a special base case, but for larger odd-length arrays the middle is ignored so that symmetry, not self-comparison, drives the result.
But why arbitrarily let length 1 arrays count but not larger odd length arrays? Wouldnt it make way more sense to treat them the same?
Thanks for pointing that out . I’ve updated the description to remove the ambiguity.
If an element can be a mirror of itself,
[42]should return0, and[1, 2, 3, 4, 5]should return2.If an element can not be a mirror of itself,
[42]should return-1, and[1, 2, 3, 4, 5]should return-1.This needs to be specified in description.
But
arr[2] == arr[5-1-2] == 3[1,2,3,4,5] has no mirror index because none of its elements equal their reflected partner.
Why does
[1,2,3,4,5]have no mirror index but[42]has one?It may matter thatpowis directly imported into JS. Helpers that are called but not imported may have a little more leeway.no, that's probably not it
getting
in the random tests of the sample tests
Please use spoiler flag next time, your post was visible in the homepage.
Loading more items...