I wrote the code, but during the test it says length error, costs length 20! = 1
here is the output
Most likely that means you hard-coded the number of iterations on the call to optimize
from model
, instead of respecting the parameter that was actually passed.