educative.io

Avoid global variable

Is there a solution to this which avoids the need for a global variable?

Hi Hasan,

Thank you for reaching out to us and giving your feedback. We’ll get back to you soon!

If you have any further concerns/questions/comments, please let us know.

Best regards,
Educative Team

This is my solution without using the global variable:
My solution