Find Positions
C++\ncpp\nint semiOrderedPermutation(vector<int>& n) {\n    int first = find(begin(n), end(n), 1) - begin(n);\n    int last = find(begin(n), end(n), n.size()) -
**C++**\n```cpp\nint semiOrderedPermutation(vector<int>& n) {\n    int first = find(begin(n), end(n), 1) - begin(n);\n    int last = find(begin(n), end(n), n.size()) - begin(n);\n    return first + (n.size() - last - 1) - (first > last);\n}\n```
['C']