C++ || MEMOIZATION SOLUTION||99% faster
\nclass Solution {\npublic:\n    \ndouble dp[26][26][101];\n    double recurs(int n, int k, int row, int col)\n    {\n        if(row<0||row>=n||col<0||col>=n)\n
```\nclass Solution {\npublic:\n    \ndouble dp[26][26][101];\n    double recurs(int n, int k, int row, int col)\n    {\n        if(row<0||row>=n||col<0||col>=n)\n        {\n            return 0;\n        }\n        if(k==0)\n        {\n          \n            return 1;\n        }\n        \n        if(dp[row][col][k])\n        {\n            return dp[row][col][k];\n        }\n        \n\n        double sum=0;\n        sum=recurs(n,k-1,row-1,col-2)+\n        recurs(n,k-1,row+1,col-2)+\n        recurs(n,k-1,row-2,col-1)+\n        recurs(n,k-1,row+2,col-1)+\n        recurs(n,k-1,row-2,col+1)+\n        recurs(n,k-1,row+2,col+1)+\n        recurs(n,k-1,row-1,col+2)+\n        recurs(n,k-1,row+1,col+2);\n        \n        sum/=8;\n        return dp[row][col][k]=sum;\n    }\n\n    \n    double knightProbability(int n, int k, int row, int column) {\n         \n      return  recurs(n,k,row,column);\n    }\n};\n```
['Memoization', 'C']