Roblox interview question

Processing a matrix for validity checking based on some rules.