🤝👑Beginner friendly code - Explanation for each line is given in the editor! Peace at the end.
Support\nIf you liked my approach and explanation, kindly upvote, or comment your views. Happy Learning! Peace!\n# Intuition\nSimply add the probability(value) 
# Support\nIf you liked my approach and explanation, kindly upvote, or comment your views. Happy Learning! Peace!\n# Intuition\nSimply add the probability(value) of moves for eack \'k\' in a 2D Array, finally sum the values up, you will find the answer. Array updation is important for each \'k\' moves\n# Requirements\nPlease use "Debugger" or "Pen and Paper" for better understanding of work-flow.\n\n\n\n# Code\n```\nclass Solution {\n\n    public double knightProbability(int n, int k, int row, int column) {\n\n        //CREATING DOUBLE TYPE 2D ARRAYS TO STORE THE PROBABILITY VALUES IN DOUBLE. THESE ARRAYS WILL HAVE THE PROBABILITY VALUES OF FUTURE MOVES OF KNIGHT.\n        double [][] curr = new double[n][n];\n        double [][] next = new double[n][n];\n        curr[row][column] = 1;  //INITIALLY, THE PLACE WHERE THE KNIGHT IS PRESENT (i.e. AT r, c position) will be marked as \'1\' - denotes success.\n\n        for (int t = 0; t < k; t++) { //LOOP UNTIL \'k\' TIMES (k MOVES)\n            \n            //NOW CHECK IF THE VALUE IN curr ARRAY IS NOT EQUAL TO \'0.0\'. (note: by default, all the values will be 0.0 in both arrays.\n            for (int i = 0; i < n; i++) {\n                for (int j = 0; j < n; j++) {\n                    if (curr[i][j] != 0) \n                    {\n                        //THE BELOW 8 BLOCKS ARE JUST TO EVALUATE THE VALID MOVES OF KNIGHT FROM THE PLACE IT IS PRESENT.\n                        //ni and nj are the variables that contains the possible moves.\n                        // isValid() WILL EVALUATE IF ni AND nj ARE PRESENT INSIDE THE CHESS BOARD RANGE AND ARE NON-NEGATIVE. IF THEY ARE NEGATIVE OR GREATER THAN \'n\' VALUE, THEN THE KNIGHT WOULD BE OUTSIDE THE CHESS-BOARD.\n                        \n                        int ni = i - 2;\n                        int nj = j - 1;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0; //DIVIDE BY 8, BECAUSE NUMBER OF POSSIBLE SUCCESSFUL EVENTS FOR KNIGHT ARE 8.\n                            //(NOTE: LOOK AT THIS COMMENT WHEN k = 2 OR GREATER). WHEN K =2, WE ADD THE VALUE TO next ARRAY AS ((1/8.0)/8.0). THIS IS BECAUSE, WHEN k = 1, THE POSSIBLE MOVES WERE MARKED AS (1/8.0), WHEN k = 2 OR MORE, THE DIVISION WITH 1/8.0 KEEPS ON GOING.\n                            //THIS IS BECAUSE, THE KNIGHT HAS 7 OTHER POSSIBLE WAYS, IT WOULD HAVE CHOSEN ANY OF THOSE PATHWAYS. TO CONCLUDE THAT IT WILL CHOOSE ONLY ONE PATHWAY, THE PROBABILITY OF SUCCESS MOVES DECREASES FURTHER, AS WE CONSIDER A SINGLE PATH.\n\n\n                        }\n                         ni = i - 1;\n                         nj = j - 2;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0;\n                        }\n                         ni = i + 1;\n                         nj = j - 2;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0;\n                        }\n                         ni = i + 2;\n                         nj = j - 1;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0;\n                        }\n                         ni = i - 2;\n                         nj = j + 1;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0;\n                        }\n                         ni = i - 1;\n                         nj = j + 2;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0;\n                        }\n                         ni = i + 1;\n                         nj = j + 2;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0;\n                        }\n                         ni = i + 2;\n                         nj = j + 1;\n                        if (isValid(ni,nj,n)){\n                            next[ni][nj] += curr[i][j] / 8.0;\n                        }\n                    }\n                }\n            }\n\n            //IMAGINE THIS LIKE, IF THE VALUES AT "curr" ARRAY ARE GREATER THAN 0, THEN IT IS OBVIOUS THAT \'KNIGHT\' IS PRESENT IN THAT POSITION. TAKING THIS POSITION AS REFERENCE, WE MARK THE POSSIBLE MOVES IN "next" ARRAY.\n            \n            curr = next;\n            //"curr" ARRAY ACTUALLY CONTAINS THE FINAL PROBABILITY ARRAY AT k MOVES.\n            next = new double[n][n];\n        }\n\n        double sum = 0;\n        //FINALYY ADD THE VALUES AND RETURN THEM.\n        for (int i = 0; i < n; i++) {\n            for (int j = 0; j < n; j++) {\n                sum += curr[i][j];\n            }\n        }\n\n        return sum;\n\n    }\n\n    static boolean isValid(int ni, int nj, int n) {\n        if (ni >= 0 && nj >= 0 && ni < n && nj < n) return true;\n        return false;\n    }\n    \n}\n```
['Array', 'Java']