solution buy1-get1 problem