Question d’entretien chez Capital One

One matrix question from leetcode