s.compactMap{$0.wholeNumberValue}

```swift []
class Solution {
    func hasSameDigits(_ s: String) -> Bool {
        var arr = s.compactMap{$0.wholeNumberValue}

        while arr.count > 2 {
            for i in 1..<arr.count {
                arr[i-1] = (arr[i-1] + arr[i]) % 10
            }
            arr.removeLast()
        }
        
        return arr[0] == arr[1]
    }
}
```
['Math', 'String', 'Swift', 'Python', 'Python3']