Russian doll test case question

Could anyone help to enlighten me why this gives a result of 5 but not 4...
envelopes = [[2,100],[3,200],[4,300],[5,500],[5,400],[5,250],[6,370],[6,360],[7,380]]

[2,100]
[3,200]
[4,300]
[5,500]

The rest have heights all < 500...

Comments (1)