https://leetcode.com/problems/determine-if-string-halves-are-alike/



Runtime: 101 ms, faster than 61.29% of TypeScript online submissions for Determine if String Halves Are Alike.

Memory Usage: 48.2 MB, less than 6.45% of TypeScript online submissions for Determine if String Halves Are Alike.



```typescript
function counting(array: string[], vowels: string[]): number {
    let counting = 0
    for (const vowel of vowels) {
        counting += array.filter((a) => vowels.includes(a)).length
    }
    return counting
}

function halvesAreAlike(s: string): boolean {
    //8:10
    let new_s = s.split("")
    const vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    const split_length = new_s.length / 2
    const a = new_s.slice(0, split_length)
    const b = new_s.slice(split_length, new_s.length)
    return counting(a, vowels) == counting(b, vowels)
    //8:14
};
```
