C5 W1 A2 (Dinosaur Island) - Grader Error on 'optimize' function (exercise 3)?

Most of this problem is due to code in the notebook using a global variable that isn’t supported by the grader.

Did you address this issue?

I hope you have an understanding of global variables. Check the below comment to make you more understand about where you could have gone wrong. and if you still not able to get, share your this part of code via DM.

Regards
DP