Company: MediaNet_july
Difficulty: medium
Matrix Pass-code Problem Description GOAT-master got arrested in a police chaos. He is trying to escape the high-tech prison he is held captive in. He needs a pass-code for disabling the systems in order to escape. Pass-code is the solution of matrix problem given below. Help him finding the pass-code. You are given a matrix of order N x M. Each cell in a matrix has a value A[i][j] >= 0, which is either positive or equal to -1 (representing blocked cell). You can traverse from a cell in any direction (up, down, left, or right) if there is no blockage (i.e., the destination cell is not -1). Cells which are not blocked have distinct values. For any cell A[i][j], its 'sed-value' S[i][j] is defined as sum of values of cells A[x][y] which are multiple of A[i][j] but not reachable from A[i][j]. For blocked cells, sed-value is 0. Pass-code P is sum of sed-values of all the cells, modulo 100000007. Examples Example 1: Input: [[1 3 -1 5], [-1 -1 -1 -1], [2 6 -1 10], [8 7 -1 11]] Output: 68 Expl