Let 'o' be the number of oranges, and
let 'a' be the number of apples initially.
Then o / a = 6 / 5, initially
Then, after the sale
(o - 24) / (a -23) = 3 / 2
We have a system of two equations with two variables:
o / a = 6 / 5
(o - 24) / (a -23) = 3 / 2
If we isolated one variable in an equation, and
substitute it in the other equation, we'd have an equation with one, the other, variable.
From the first equation o = 6a / 5, then
(6a / 5 - 24) / (a - 23) = 3 / 2
Cross-multiply
2 * (6a / 5 - 24) = 3 * (a - 23)
12a / 5 - 48 = 3a - 69
Multiply both sides by 5:
12a - 240 = 15a - 345
3a = 105
a = 35 (initially)
a - 23 = 12 (in the end) - Answer to the question of the problem.
Let's verify our answer
Initially, a = 35, then
initially o = 6/5 * a = 42
a - 23 = 2/3 * (o - 24)
12 = 2/3 * 18
12 = 12 -> True
Answer: 12 apples remained at the end.