Swift 🍏
Complexity\n- Time complexity:\nO(log(n))\n- Space complexity:\nO(1)\n# Code\nswift []\nclass Solution {\n    func evenOddBit(_ n: Int) -> [Int] {\n        var 
# Complexity\n- Time complexity:\n$$O(log(n))$$\n- Space complexity:\n$$O(1)$$\n# Code\n```swift []\nclass Solution {\n    func evenOddBit(_ n: Int) -> [Int] {\n        var n = n\n        var result = [0, 0]\n\n        while n != 0 {\n            result[0] += n & 1\n            n >>= 1\n            result[1] += n & 1\n            n >>= 1\n        }\n\n        return result\n    }\n}\n```
['Swift']