Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
@natan True, but the whole point was about me beeing confused. It just took B1t's message to make me realize the problem. Thx anyway :)
literally the first thing I told you
Thanks B1ts! Finally a good information that solved the misunderstanding!
No offense but yes, I read your comments, and exactly from your comments i figured out that most probably you did what you think was cloning, but really was not ;)
Because they cloned it? It doesn't affect the original array.
myvar = inputvar
doesn't clone anything, it's just another variable name pointing to the same input array.read my second one. Thats what I mean. It should not be this way. Anyway...thanks for trying
read my first reply in this thread
I can't remember for sure but I was doing something like this:
myvar = inputvar
doing stuff with myvar and return it
feedback: You are not allowed to mutate...:(
so how can other people swap stuff arround with cloned arrays?
this is what's going on:
When we talk about the original array, are we referring to the original variable itself, or just the order of the elements? At first, I tried to modify the original variable directly. Then, I made a copy of the array and tried to modify the copy, but that didn’t work either. I saw other solutions where people were just swapping elements within the array, which suggests they must have been modifying the original 'order of elements'... It's confusing, isn’t it?
You DID mutate the original array. That is exactly what that test measures. It looks at the array before and after. That's also why it doesn't want you to mutate it. The caller doesn't want their stuff to be scrambled. Your method should look at it but not touch it.
The more general applicable advice here, I think, is that you should ensure that you can observe and reproduce whatever it is you are trying to fix. So that you KNOW it's happening. Not just for kata, but for any bug, or really anything that you're trying to change. Don't be blind, look at the thing you're doing.
Hobovsky, no offense, but did you actually read what I just said? :) I did not try to manipulate the original array. I created a new one, still could not manipulate it
It already says it in the description: "should return a new array ", and "it should not mutate the input array", etc.
As a Kyu7 task, it should highlight this kind of 'rabbit hole' to help prevent people from falling too deeply into it.
sounds to me like you created a new variable instead of copying the array
Loading more items...