Hey xinlo.

For this problem you might want to use a metric where d(x,y) = SQRT((x0-y0)^2 + (x1-y1)^2 + (x2-y2)^2) where (x0,x1,x2) is LWH for item 1 and (y0,y1,y2) is LWH for item 2.

Smaller value indicates closer fit.

This is a very crude way of doing it but it does provide a starting point.