✅ Swift: Easy to Understand and Simple Solution
\n\n# Code\n\nclass Solution {\n    func evenOddBit(_ n: Int) -> [Int] {\n        var (n, i, ans) = (n, 0, [0, 0])\n        \n        while n>0{\n            if
\n\n# Code\n```\nclass Solution {\n    func evenOddBit(_ n: Int) -> [Int] {\n        var (n, i, ans) = (n, 0, [0, 0])\n        \n        while n>0{\n            if n%2 == 1{\n                ans[i%2] += 1\n            }\n            \n            i += 1\n            n /= 2\n        }\n        \n        return  ans\n    }\n}\n\n```
['Swift']