sold → 2/5 left → 1/3 total → 1 (whole)
donated (fractions) → 1 - 2/5 - 1/3 = 1 - 6/15 - 5/15 = 4/15
donated → 104
4/15 mangoes → 104 1/15 mangoes → 104 ÷ 4 = 26
"He was left with 1/3 of the mangoes and packed them"
packed (left) → 1/3 = 5/15
5/15 mangoes → 26 x 5 = 130
Assumption
step 1: assume all bags contain 4 mangoes
assumed total → 24 x 4 = 96
step 2: find difference
total difference → actual total - assumed total = 130 - 96 = 34
value difference → 6 - 4 = 2
Step 3: divide
number of bags of 6 mangoes → total difference ÷ value difference = 34 ÷ 2 = 17