This is a short but O(N^{2}) time and O(N) space TLE solution, so probably not what you want. The idea is to simply record each interval (min_{k<i} nums_{k}, nums_{i}) and check whether current value nums_{i} is in any previous such intervals.

```
bool find132pattern(vector<int>& nums) {
vector<pair<int, int>> intervals; int curMin = INT_MAX;
for (int x:nums) {
for (auto& i : intervals) if (i.first < x && x < i.second) return true;
intervals.emplace_back(curMin = min(curMin, x), x);
}
return false;
}
```