Simple java code 1 ms beats 100 %
\n# Complexity\n- \n\n# Code\n\nclass Solution {\n    public int[] circularGameLosers(int n, int k) {\n        int arr[]=new int[n];\n        int i=0;\n        
\n# Complexity\n- \n![image.png](https://assets.leetcode.com/users/images/59000afc-f577-4b4d-b0eb-9e61009d33ac_1703500083.2413101.png)\n# Code\n```\nclass Solution {\n    public int[] circularGameLosers(int n, int k) {\n        int arr[]=new int[n];\n        int i=0;\n        int j=k;\n        int c=0;\n        while(true){\n            if(arr[i]==1){\n                break;\n            }\n            c++;\n            arr[i]=1;\n            i=(i+j)%n;\n            j=j+k;\n        }\n        c=n-c;\n        int arr2[]=new int[c];\n        j=0;\n        for(i=0;i<n;i++){\n            if(arr[i]==0){\n                arr2[j++]=i+1;\n            }\n        }\n        return arr2;\n    }\n}\n```
['Java']