https://leetcode.com/problems/divide-array-into-equal-pairs/


Runtime: 122 ms, faster than 25.00% of TypeScript online submissions for Divide Array Into Equal Pairs.

Memory Usage: 50.3 MB, less than 6.25% of TypeScript online submissions for Divide Array Into Equal Pairs.


```typescript
function divideArray(nums: number[]): boolean {
    //8:24
    const countingMap = new Map()
    for (const [index, value] of nums.entries()) {
        if (countingMap.has(value)) {
            countingMap.set(value, countingMap.get(value) + 1)
        } else {
            countingMap.set(value, 1)
        }
    }
    
    const values = []
    for (let [key, value] of countingMap) {
        values.push(value)
    }
    
    values.sort(function(a, b){return a - b});
    
    const minNum = values[0]
    if (minNum < 2) {
        return false
    }
    
    let OK = true
    for (let [key, value] of values.entries()) {
        if (value % minNum != 0) {
            OK = false
            break
        }
    }
    
    return OK
    //8:32
};
```
