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.
that filter at the end is so cleverly put.. impressive !!
Please read the description.
It seems to only work if the unique number is either the biggest or the smallest in the array. I doesn't work with [ 1, 1, 1, 2, 1, 3, 3, 1 ], for example
Thanks, that took me down an interesting rabbit hole.
Yes, it's correct in a way that it conforms to commonly recognized conventions.
By convention, exponentiation operator is right associative, unlike other arithmetic operators (addition, subtraction, multiplication, division). While
a+b+c
is the same as(a+b)+c
, thea^b^c
and$ a ^ { b ^ c } $
area^(b^c)
. It's a general convention in math notation, and not something specific for this kata.Assert.AreEqual("-3906251", ev.eval("-5&3&2*2-1"));
Left to right evaluations? Why is the test doing 5^9? https://www.google.com/search?q=The+Power+Rule+for+Exponents
I know if I throw 5^3^2 in google it gives me that big ugly number too.. but is that actually correct?
Fun kata! Did anyone else solve it with a regex?
omg super-clever, i kneel bevor thee
Maybe because it's bad in terms of complexity and it mutates the input.
how did i dont think of this. smh
And that would be a totally different problem:
Perfect decision. But it doesn't work, if there are two or more similar numbers.
Frex let arr = [5,120,3,7,33,3,33,33,7,3,120];
again...
The description says "The tests contain some very huge arrays, so think about performance." so whilst it's not asking specifically for the most performant solution, it is implied.
I was skeptical of the performance too. I could definitely be wrong, but I think this sort implementation is insertion sort which is actually very fast on a "nearly sorted" array, which we know this one is. So this solution may actually be good on performance too (which this kata did actually mention, and is always a concern as far as "best practices" go).
Loading more items...