Implement min and max for array lengths

Min and max for array lengths