Compact Solution in Python 3 (nine lines)
Compact Version:\n\nclass Solution:\n    def orderOfLargestPlusSign(self, N: int, M: List[List[int]]) -> int:\n    \tDP, M, R, T, m = [[math.inf]*N for i in ran
_Compact Version:_\n```\nclass Solution:\n    def orderOfLargestPlusSign(self, N: int, M: List[List[int]]) -> int:\n    \tDP, M, R, T, m = [[math.inf]*N for i in range(N)], {tuple(m) for m in M}, list(range(N)), (0,1), 0\n    \tfor k,i in itertools.product(T,R):\n    \t\tfor _ in T:\n    \t\t\tc, I, _ = 0, i, R.reverse()\n    \t\t\tfor j in R:\n    \t\t\t\tif k: i,j = j,i\n    \t\t\t\tc = 0 if (i,j) in M else c + 1\n    \t\t\t\tDP[i][j], i = min(DP[i][j],c), I\n    \treturn max(max(i) for i in DP)\n\t\t\n\n```\n_Long Version:_\n```\nclass Solution:\n    def orderOfLargestPlusSign(self, N: int, M: List[List[int]]) -> int:\n    \tDP, M, m = [[0]*N for i in range(N)], {tuple(m) for m in M}, 0\n    \tfor i in range(N):\n    \t\tc = 0\n    \t\tfor j in range(N):\n    \t\t\tc = 0 if (i,j) in M else c + 1\n    \t\t\tDP[i][j] = c\n    \t\tc = 0\n    \t\tfor j in range(N-1,-1,-1):\n    \t\t\tc = 0 if (i,j) in M else c + 1\n    \t\t\tDP[i][j] = min(DP[i][j],c)  \t\t\t\n    \tfor j in range(N):\n    \t\tc = 0\n    \t\tfor i in range(N):\n    \t\t\tc = 0 if (i,j) in M else c + 1\n    \t\t\tDP[i][j] = min(DP[i][j],c)\n    \t\tc = 0\n    \t\tfor i in range(N-1,-1,-1):\n    \t\t\tc = 0 if (i,j) in M else c + 1\n    \t\t\tm = max(m,min(DP[i][j],c))\n    \treturn m\n\t\t\n\t\t\n\t\t\n- Junaid Mansuri\n(LeetCode ID)@hotmail.com
['Python', 'Python3']