Java Solution w/ Comments
\nclass Solution {\n    public int bestRotation(int[] A) {\n        int len = A.length;\n        \n        // Store scores for each K value\n        int[] kScor
```\nclass Solution {\n    public int bestRotation(int[] A) {\n        int len = A.length;\n        \n        // Store scores for each K value\n        int[] kScores = new int[len];\n        \n        for (int i = 0; i < len; i ++) {\n            int v = A[i];\n            // Ideal K is the K that puts A[i] in location i.\n            int idealK = (len - v + i) % len;\n            // Increment kScores for all possible K\'s s.t. v in A rotated by K will improve the score.\n            for (int j = 0; j < len - v; j ++) {\n                kScores[idealK] = kScores[idealK] + 1;\n                idealK --;\n                if (idealK < 0) idealK = len - 1;\n            }\n        }\n        \n        // Get the best K\n        int bestK = 0;\n        int bestScore = -1;\n        for (int k = 0; k < len; k ++) {\n            int score = kScores[k];\n            if (score > bestScore) {\n                bestK = k;\n                bestScore = score;\n            }\n        }\n        \n        return bestK;\n    }\n}\n```
[]