• ###### loliconercommented on "Next smaller number with the same digits" javascript solution

The performance may be slow.

• ###### JohanWiltinkcommented on "Even or Odd" javascript solution

Honestly, if you can't read this, I couldn't explain.

If you don't know where to look up `&`, try here.

• ###### Eng Stucommented on "Even or Odd" javascript solution

how does it work?

• ###### aimbot_kruegercommented on "Sum of Intervals" javascript solution

Holly one-line

• ###### AndrewSouthpawcommented on "Range Extraction" ruby solution

Ohhhh man today I learned about `chunk_while`, I wanted something like that in my JS solution as well. This is why I love comparing solutions. :)

• ###### matttttttttcommented on "Range Extraction" ruby solution

This comment is hidden because it contains spoiler information about the solution

• ###### zhw2590582commented on "-Reverse it, quickly!" javascript solution

This can't flip the array on the browser

• ###### zhw2590582commented on "Next smaller number with the same digits" javascript solution

function nextSmaller(n) {
const nStr = String(n).split('').sort().join('');
for (let i = n - 1; i >= Number(nStr); i--) {
const iStr = String(i).split('').sort().join('');
if (iStr === nStr) {
return i;
}
}
return -1;
}

Awesome!

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

Let me rephrase my comment. It's order x^3 because there are 3 nested loops (find, indexOf and lastIndexOf);

It isn't.

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

This solution does not perform well. This function is O(x^3).

• ###### Barty-Boycommented on "Next smaller number with the same digits" javascript solution

at first glance I just wanted to quote the persian guy from 300 movie... but finally I sang Bryan Adam's please forgive me to regExp ;-). That's neat!

• ###### anter69commented on "Password generator" ruby solution

This doesn't always generate correct passwords. It passes only becasue the checker function is broken.

Elegant.