If Tom eats T chocolates, then James eats T-3 and Dave eats T-3+9=T+6.
Together they eat all 45 chocolates: T+T-3+T+6=45.
3T+3=45, T+1=15 (dividing by 3), T=14, Tom eats 14 chocolates.
To solve without algebra: add the 3 chocolates James didn’t eat (compared with Tom) to the total number of chocolates, making 48. Then take away six chocolates (the difference between the 9 Dave ate and the three James didn’t eat) from 48=42. This is now the number of chocolates as if all three ate the same number of chocolates, so we divide 42 by 3=14. So Tom ate 14 chocolates.