Input{"envelopes":[[1,999999999],[2,999999998],[3,999999997],[4,999999996],[5,999999995],[6,999999994],[7,999999993],[8,999999992],[9,999999991],[10,999999990],[11,999999989],[12,999999988],[13,999999987],[14,999999986],[15,999999985],[16,999999984],[17,999999983],[18,999999982],[19,999999981],[20,999999980],[21,999999979],[22,999999978],[23,999999977],[24,999999976],[25,999999975],[26,999999974],[27,999999973],[28,999999972],[29,999999971],[30,999999970],[31,999999969],[32,999999968],[33,999999967],[34,999999966],[35,999999965],[36,999999964],[37,999999963],[38,999999962],[39,999999961],[40,999999960],[41,999999959],[42,999999958],[43,999999957],[44,999999956],[45,999999955],[46,999999954],[47,999999953],[48,999999952],[49,999999951],[50,999999950],[51,999999949],[52,999999948],[53,999999947],[54,999999946],[55,999999945],[56,999999944],[57,999999943],[58,999999942],[59,999999941],[60,999999940],[61,999999939],[62,999999938],[63,999999937],[64,999999936],[65,999999935],[66,999999934],[67,999999933],[68,999999932],[69,999999931],[70,999999930],[71,999999929],[72,999999928],[73,999999927],[74,999999926],[75,999999925],[76,999999924],[77,999999923],[78,999999922],[79,999999921],[80,999999920],[81,999999919],[82,999999918],[83,999999917],[84,999999916],[85,999999915],[86,999999914],[87,999999913],[88,999999912],[89,999999911],[90,999999910],[91,999999909],[92,999999908],[93,999999907],[94,999999906],[95,999999905],[96,999999904],[97,999999903],[98,999999902],[99,999999901],[100,999999900]]}
Expectednull
⏱ Performance - must finish in 2000ms
n=100, O(n log n) solution must complete within 2 seconds; brute force O(n^2) likely to TLE.
✓ Efficient O(n log n) solution confirmed by passing performance test.