Added MaxProductOfThress

added maxproduct and updated sort function for distinct