A little rough to say I "ruined" it with performance, don't ya think?
That said, I see including a large data parsing requirement as similar to the difference between someone solving a software problem for a small local business versus a Fortune 500 company. Being able to code solutions for data at scale can make a huge difference in someones paygrade.
I saw it. My point was that the tests passed the right arrays, and expected results were correct, so the issue wasn't with the kata itself. I agree that every var should be replaced with const / let but that's a minor issue (especially considering that the kata is in beta for 7 or so years).
I'm not an oracle, so I don't know. Global variables? Confusion?
You can always go to Solutions tab and fork any solution, and play around with it. You can modify tests as you see fit (you will notice that adding const doesn't change anything). Tests pass a copy of the array, so the expected result isn't affected by your code.
Yeah, i think that make a sence
This comment is hidden because it contains spoiler information about the solution
Cool!
I did O(n^2) and got timed out. what's wrong with mine?
You're doing a large amount of unncessary work. Your logic is on the correct path, but you need to avoid going over all the numbers.
Merged.
what would be the point of that ? your code is much longer and more cumbersome to write than a legitimate solution.
A little rough to say I "ruined" it with performance, don't ya think?
That said, I see including a large data parsing requirement as similar to the difference between someone solving a software problem for a small local business versus a Fortune 500 company. Being able to code solutions for data at scale can make a huge difference in someones paygrade.
The lists in this case could have 10000 elements, so printing them would be too verbose.
https://docs.codewars.com/training/troubleshooting#print-input
If you're looking for the version where O(n) is expected, it's this kata.
You can start by really reading into the description :D
I saw it. My point was that the tests passed the right arrays, and expected results were correct, so the issue wasn't with the kata itself. I agree that every
var
should be replaced withconst / let
but that's a minor issue (especially considering that the kata is in beta for 7 or so years).I'm not an oracle, so I don't know. Global variables? Confusion?
You can always go to Solutions tab and fork any solution, and play around with it. You can modify tests as you see fit (you will notice that adding
const
doesn't change anything). Tests pass a copy of the array, so the expected result isn't affected by your code.Loading more items...