• ###### jdx-codecommented on "Mexican Wave" javascript solution

that filter at the end is so cleverly put.. impressive !!

• ###### Chrono79commented on "Find the unique number" javascript solution

All numbers are equal except for one.

• ###### Nad.Chelcommented on "Find the unique number" javascript solution

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

• ###### TreeHopUpresolved a question on "Parsing and evaluation of mathematical expressions" kata

Thanks, that took me down an interesting rabbit hole.

• ###### hobovskycommented on "Parsing and evaluation of mathematical expressions" kata

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, the a^b^c and \$ a ^ { b ^ c } \$ are a^(b^c). It's a general convention in math notation, and not something specific for this kata.

• ###### TreeHopUpcreated a question for "Parsing and evaluation of mathematical expressions" 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?

• ###### Safturcommented on "Basics 08: Find next higher number with same Bits (1's)" kata

Fun kata! Did anyone else solve it with a regex?

• ###### manikarancommented on "Automorphic Number (Special Numbers Series #6)" cpp solution

omg super-clever, i kneel bevor thee

• ###### Madjoszcommented on "Find the unique number" javascript solution

Maybe because it's bad in terms of complexity and it mutates the input.

• ###### markbrew3commented on "Find the unique number" javascript solution

how did i dont think of this. smh

• ###### Chrono79commented on "Find the unique number" javascript solution

And that would be a totally different problem:

All numbers are equal except for one.

• ###### -Franky-commented on "Find the unique number" javascript solution

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...

• ###### z1090commented on "Find the unique number" javascript solution

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.

• ###### andyknollacommented on "Find the unique number" javascript solution

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).