Need help with array!

I’ll add link to the proposed solution here aswell Can someone PLZ tell me what's wrong with my code? - #3 by Squize