turns out I should rather use a byte type, either byte or boolean to declare the matrix, because we only need to store a 0/1 state, so no need to use int. That's a 4N^2 to N^2 memory improvement and that passed the assessment with 100% grade.