Beats 100.00% of users with Swift
\n\nclass Solution {\n    func circularGameLosers(_ n: Int, _ k: Int) -> [Int] {\n        var set_friends : Set<Int> = []\n        var player = 0\n        var c
\n```\nclass Solution {\n    func circularGameLosers(_ n: Int, _ k: Int) -> [Int] {\n        var set_friends : Set<Int> = []\n        var player = 0\n        var count = 0\n        var ans = [Int]()\n\n        while !set_friends.contains(player){\n            set_friends.insert(player)\n            count += 1\n            player = (player + count*k) % n\n        }\n\n        for i in 0..<n {\n            if !set_friends.contains(i){\n                ans.append(i + 1)\n            }\n        }\n\n        return ans\n    }\n}\n```
['Swift']