As an alternative to std::map, I often find it's nicer to use a sorted vector and run a binary search (aka 'lower_bound').

I'm starting to have doubts about the timing accuracy of leetcode across languages. This runs in ~116 ms and 'beats 86.9% ...'

```
vector<int> findRightInterval(vector<Interval>& intervals)
{
auto N = static_cast<int>(intervals.size());
struct Item {
int value;
int index;
};
vector<Item> starts(N + 1);
for (int i = 0; i < N; ++i)
{
starts[i] = { intervals[i].start, i };
}
// 'not found' value
starts.back().index = -1;
auto cmpval = [](const Item& lhs, const Item& rhs)
{ return lhs.value < rhs.value; };
sort(begin(starts), end(starts) - 1, cmpval);
vector<int> res(N);
for (int i = 0; i < N; ++i)
{
Item item = { intervals[i].end, i };
auto iter = lower_bound(
begin(starts), end(starts) - 1,
item, cmpval);
res[i] = iter->index;
}
return res;
}
```