Leetcode problem Merge intervals

Question link:-https://leetcode.com/problems/merge-intervals/

code link

I am having trouble inserting elements from vector of vectors to another vector of vectors. Can you please correct the code!

Hey @div_yanshu07 this problem can be solved either by using multimap or two pointers approach. Since your approach is quite similar to two pointer approach , see this https://ide.codingblocks.com/s/367152
You will get an idea of where we’re you wrong.

It’s just for understanding purpose. Apply this in your code.

Can you tell me what ans.back()[1] means?
It would be great of you if you could explain it using example.

It means that the last element of the vector and it’s first index
For example vector v is
V= {{1,1,2},{2,3,4}}
Here V.back()[1] means 3