Count Elements With Strictly Smaller and Greater Elements Problem

Count Elements With Strictly Smaller and Greater Elements Problem — ExecCode Easy DSA Practice

Solve the Count Elements With Strictly Smaller and Greater Elements problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given an integer array nums, return the number of elements that have both a strictly smaller and a strictly greater element appear in nums.

Examples

Input {"nums": [11, 7, 2, 15]}; Output 2. Input {"nums": [-3, 3, 3, 90]}; Output 2

Constraints

1 <= nums.length <= 100 -10^5 <= nums[i] <= 10^5

Practice Count Elements With Strictly Smaller and Greater Elements free on ExecCode. Browse DSA problems, topic map, and placement guides.