Python short & simple DFS w/ memoization 
\nclass Solution:\n    def knightProbability(self, N, K, r, c):\n        memo = {}\n        def dfs(i, j, p, k): \n            if 0 <= i < N and 0 <= j < N and 
```\nclass Solution:\n    def knightProbability(self, N, K, r, c):\n        memo = {}\n        def dfs(i, j, p, k): \n            if 0 <= i < N and 0 <= j < N and k < K:\n                sm = 0\n                for x, y in ((-1, -2), (-2, -1), (-2, 1), (-1, 2), (1, 2), (2, 1), (2, -1), (1, -2)):\n                    if (i + x, j + y, k) not in memo:\n                        memo[(i + x, j + y, k)] = dfs(i + x, j + y, p / 8, k + 1)\n                    sm += memo[(i + x, j + y, k)]\n                return sm\n            else:\n                return 0 <= i < N and 0 <= j < N and p or 0\n        return dfs(r, c, 1, 0)\n```
[]