I solved the problem on my local IDE with no issues, but the InterviewBit IDE is complaining when I sort the intervals array using a lambda function as the key. Below is the code and the runtime error that I get, can someone help me out and make me understand what the problem is?

def merge(self, intervals):

```
intervals, i = sorted(intervals, key = lambda x: x[0]), 0
print(intervals)
while i < len(intervals) - 1:
if intervals[i][1] >= intervals[i+1][0]:
intervals[i] = [intervals[i][0], intervals[i+1][1]]
intervals.pop(i+1)
return intervals
```

Error: Traceback (most recent call last):

File “main.py”, line 186, in

result = obj.merge(v)

File “/tmp/judge/solution.py”, line 12, in merge

intervals, i = sorted(intervals, key = lambda x: x[0]), 0

File “/tmp/judge/solution.py”, line 12, in

intervals, i = sorted(intervals, key = lambda x: x[0]), 0

AttributeError: Interval instance has no attribute ‘**getitem**’