https://leetcode.com/problems/count-elements-with-strictly-smaller-and-greater-elements/



Runtime: 104 ms, faster than 69.35% of TypeScript online submissions for Count Elements With Strictly Smaller and Greater Elements .

Memory Usage: 48.8 MB, less than 6.45% of TypeScript online submissions for Count Elements With Strictly Smaller and Greater Elements .



```typescript
function countElements(nums: number[]): number {
    //8:31
    let counting = 0
    for (const [index, value] of nums.entries()) {
        let condition_a = false
        let condition_b = false
        for (const [i2, v2] of nums.entries()) {
            if (i2 != index) {
                if (v2 < value) {
                    condition_a = true
                }
                if (v2 > value) {
                    condition_b = true
                }
                if (condition_a && condition_b) {
                    counting += 1
                    break
                }
            }
        }
    }
    return counting
    //8:34
};
```
