✅🚀 || Steps Explained || Beginner friendly || JAVA ||
Approach\n Describe your approach to solving the problem. \nSince, the index of an array starts from 0 there will be a huge confusion during the circular traver
# Approach\n<!-- Describe your approach to solving the problem. -->\nSince, the index of an array starts from 0 there will be a huge confusion during the circular traversal.\nThe cicular traversal of an array is always a hectic process until or unless you don\'t know how to handle the edge cases.\n\nHere, by following the gven above conditions:\n\nOur Solution includes 3 steps\n1. Passing the ball and marking the **visited** friends in visited array.\n2. Finding the no of losers(unvisited) from visited array.\n3. Adding the losers(unvisited) to the resultant array and returning it.\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(N)$$\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(N)$$\n\n# Code\n\n\n```java []\nclass Solution {\n    public int[] circularGameLosers(int n, int k) {\n       \n        boolean[] vis=new boolean[n+1];\n        \n        //Step - 1\n        int curr_friend=1,i=1;\n        do\n        {\n            vis[curr_friend]=true;\n            curr_friend=(curr_friend+i*k)%n;\n            if(curr_friend==0)\n            {\n                curr_friend=n;\n            }\n            i++;\n        }while(vis[curr_friend]==false);\n        \n        \n        //Step-2\n        int size=0;\n        for( i=1;i<=n;i++)\n        {\n            if(!vis[i])\n                size++;\n        }\n\n        //Step-3\n        int[] res=new int[size];\n        int j=0;\n        for( i=1;i<=n;i++)\n        {\n            if(!vis[i])\n                res[j++]=i;\n        }\n        \n        return res;\n    }\n}\n\n\n```
['Array', 'Game Theory', 'Java']