Golang very simple O(n) solution
go\nfunc countVowels(word string) int64 {\n    vowel := int64(0)\n    magic := int64(0)\n    for i, v := range word {\n        switch v {\n        case \'a\', \
```go\nfunc countVowels(word string) int64 {\n    vowel := int64(0)\n    magic := int64(0)\n    for i, v := range word {\n        switch v {\n        case \'a\', \'e\', \'i\', \'o\', \'u\':\n            magic += int64(i) + 1\n        }\n        vowel += magic\n    }\n    return vowel\n}\n```
['Go']