• ###### ejini战神created an issue for "Adding useful functional functionality to JavaScript arrays " kata

No random tests in JS

• ###### fialkovodcommented on "Two Oldest Ages" javascript solution

for input like [8,10,10,1] you'll get [10,10] instead of [8,10]

• ###### javokhir12commented on "Two Oldest Ages" javascript solution

mutating array isn't

• ###### Pranjal035commented on "Two Oldest Ages" javascript solution

This can be solved in O(N) time & O(1) space.

• ###### Blind4Basicscreated an issue for "Adding useful functional functionality to JavaScript arrays " kata

no sample tests (JS)

• ###### kalisjoshuacommented on "Two Oldest Ages" javascript solution

I have basically no background in algorythm efficiency analysis so I don't focus on it ever so thank you for the explanation and suggestion; I would implement your solution using a `.reduce()` but it would equate to the same thing.

I imagine that there are more difficult kata where efficiency of the solution plays a part in success or not and I actually avoid those as it isn't something that I have ever needed to take into account.

• ###### Souzookacommented on "Two Oldest Ages" javascript solution

If you were to use `Array.sort()`, first create a new array by doing `array.slice(0)`, which will create a shallow copy of the input array. Then it can be sorted without mutating the input.

However, just using a simple for loop allows you to complete this Kata in `O(n)` instead of `O(n log(n))`; Using sort means that for large arrays you're going to see a huge performance disadvantage versus just finding the max and second max using a for loop.

• ###### kalisjoshuacommented on "Two Oldest Ages" javascript solution

Thanks for the comment. What solution suggestion do you have?

• ###### Souzookacommented on "Two Oldest Ages" javascript solution

Any solution using sort isn't best practice, as it's possible to complete this Kata in one iteration over the input array instead of spending time to sort it.

(not to mention, this mutates the input array as well!)

• ###### darie2808commented on "Sum Strings as Numbers" csharp solution

This solution does not work anymore as there is an overflow. BigInteger should probably be used.

• ###### manuc66commented on "Sum Strings as Numbers" csharp solution

Maybe the associated tests were updated in the meanwhile.

• ###### gonzabianchicommented on "Sum Strings as Numbers" csharp solution

How this code pass the test??? my first attemp with something similar failed 3 of the test... maybe the test where updated since this???

• ###### __TomFoolery__commented on "Sum Strings as Numbers" csharp solution

That was my fist try it did not pass BigInts and Null value :(

• ###### JoshSchreudercommented on "Adding useful functional functionality to JavaScript arrays " kata

Hi, I've added a CoffeeScript translation, if you want to approve it, instructions for the approval process are here.