DEV Community

Discussion on: Daily Challenge #97 - Greed is Good

Collapse
 
dwilmer profile image
Daan Wilmer

What do you mean with "Don't mutate the input"? The variable that is given isn't changed, right?

Collapse
 
juliannicholls profile image
Julian Nicholls

In some languages on Codewars (Python is the problem here, I think) it is possible to mutate the array that is passed as input. That will guarantee that the test will fail.

Generally it is not good to mutate the input to a function, unless that is the expected behaviour.