Saviynt interview question

Matrix based python problem solving question of medium complexity