Using Math model, Hashmap and Recursion
Intuition\n Describe your first thoughts on how to solve this problem. \nI will post it later.\n\n# Approach\n Describe your approach to solving the problem. \n
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nI will post it later.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int[] circularGameLosers(int n, int k) {\n        Set<Integer> set = new HashSet<>();\n        int win = winner(1, n, k, 0, set);\n        int len = n - set.size();\n        int[] res = new int[len];\n        while (len - 1 > -1) {\n            if (!set.contains(n)) {\n                res[len-1] = n;\n                len--;\n            }\n            n--;\n        }\n        return res;\n    }\n    private int winner(int player, int num, int steps, int count, Set<Integer> ballCount) {\n        boolean entry = ballCount.add(player);\n        if (!entry) {\n            return player;\n        } else {\n            count++;\n            int newSteps = count * steps;\n            if (player + newSteps <= num) {\n                player = player + newSteps;\n                return winner(player, num, steps, count, ballCount);\n            } else {\n                player = (player + newSteps - num) % num;\n                if (player == 0) return winner(num, num, steps, count, ballCount);\n                else return winner(player, num, steps, count, ballCount);\n            }\n        }\n    }\n}\n```
['Hash Table', 'Math', 'Recursion', 'Java']