The Box Stacking Statement: Given n rectangle boxes, that the i box has height h[i], width w[i] and depth d[i]. Create a stack of boxes that is the tallest one possible, but only can stack a box on top of another box if the dimensions of the 2-D base of the lower box are each strictly larger than those of the 2-D base of the higher box.
But in this problem, all the boxes are has the same height (h[1]=h[2]=...h[n]) and N <= 100000. And we don't need to rotate the boxes anymore.
Example:
n = 5
w[]={1,3,5,7,9}; d[]={5,7,4,6,8}The answer is: 3 ( [1x5] ; [3x7] ; [9x8] )
I only can solve it in O(n^2) but I need less than it (can be O(n) or O(nlogn)).