This comment is hidden because it contains spoiler information about the solution
Forked python translation with 3.8 enabled & new test framework used
Nice Kata but description is cryptic, spent too much time on understanding the task:
For arr = [1, 4, 2, 1, 4, 1, 4, 9, 7, 7, 7]
Non unique values are 1, 4 and 7
So maximum span is 6
For arr = [1, 4, 6, 1, 4, 4, 4, 8 ,6, 2, 3]
Non unique values are 1, 4 and 6
So maximum span is 7
No, natan is right, you're mutating the input value in your code. It should be fixed (now the expected value is calculated before your function is called). Try again.
no cause the extra \n is in the generated test not my return. Have a look again
Awesome solution. Clean code and well structured
fixed by chrono79 above
I tried to poke you on gitter ._.
Ok, done (for js and python). And yes, you can create a fork and let us mods (or the kata's author) know about what you fixed, it'll be of help. Thanks.
yeah python, same thing.
and yeah deep copy is weird in general, better to change the order
arr = gentest()
expected = reference(arr)
.... maybe I should be doing things myself when I know how I want them to be >_< (as opposed to backseating you) I'll change python and js after I get back from grocery shopping if you haven't already
and -- yeah it's worth it. it's not so much about cheating as it is about confusing error messages (the thread below this one remains affected)
Do you mean Python is also vulnerable to input mutation?
Is a deep copy worth the effort for this kata? I can implement it if it is, but I dunno.
Alsoo. That's not a deep copy :|
Okay, yeah, but you can still change language to python. Take that! :^)
Not anymore. And maybe I'd use spoiler flag for this kind of issues.