Python O(N^2 log(M)) solution
Worse solution than the dynamic programming one, but passes the tests.\nI create 2 lists of y coordinates of bombs along x axis and x coordinates along y axis, 
Worse solution than the dynamic programming one, but passes the tests.\nI create 2 lists of y coordinates of bombs along x axis and x coordinates along y axis, sort them\nand find the nearest bombs coordinates using binary search, then take the minimum of the 4 distances. Thought that while it\'s clearly worse, it\'s an interesting alternative.\n\n```\n\n\nclass Solution:\n    def orderOfLargestPlusSign(self, N: int, mines: List[List[int]]) -> int:\n        self.N = N\n        res = 0\n        x, y = {}, {}\n        xy = {}\n        for i in range(N):\n            x[i] = [-1,N]\n            y[i] = [-1,N]\n        for mine in mines:\n            mine_x = mine[0]\n            mine_y = mine[1]\n            x[mine_x].append(mine_y)\n            y[mine_y].append(mine_x)\n            xy[(mine_x, mine_y)] = True\n        \n        for k in range(N):\n            x[k] = sorted(x[k])\n            y[k] = sorted(y[k])\n        print(x)\n        \n        coords = (-1,-1)\n        for i in range(N):\n            for j in range(N):\n                if (i,j) not in xy:\n                    r = min(search(x[i], j), search(y[j], i))\n                    if r>res:\n                        res = r\n                        coords = (i,j)\n        print(coords)\n        return res\n                \n                \ndef search(mines, val):\n    l, r = 0, len(mines)-1\n    while l<=r:\n        m = (l+r)//2\n        if mines[m] > val:\n            v1 = mines[m]\n            r = m - 1\n        else:\n            l = m + 1\n    l, r = 0, len(mines)-1\n    while l<=r:\n        m = (l+r)//2\n        if mines[m] < val:\n            v2 = mines[m]\n            l = m + 1\n        else:\n            r = m - 1\n    return min(val-v2, v1-val)\n\n```
[]