Dylan and Jetson bought some apples in the ratio 2:3. The next day, Jetson threw away 36 of his apples which had turned bad. Then, the ratio of the number of apples that Dylan had to the number of apples that Jetson had became 6:5. How many apples did Dylan and Jetson buy altogether at first?

At the start: apples for

Dylan : Jetson = 2:3 = 2x : 3x

bad apples:
Dylan still had 2x
Jetson had 3x - 36

2x : 3x-36 = 6:5
18x - 216 = 10x
8x = 216
x = 27

together they had bought 5x or 135

check:
Dylan had 54
Jetson had 81

Jetson had 36 bad apples, so leaving him with 45
Dylan : Jetson = 54 : 45 = 6 : 5
all looks good!