I'm not sure, but I think this is the answer.
Answer:
Sara has 24-x-7
Tim has 24+x/2
Step-by-step explanation:
So for Tim, He had 24 and received x no of sweets from Sara, so
24+x
After that, he ate half of it, so
24+x/2
Now for Sara, She had 24 and gave Tim x no of sweets, so
24-x
After that, she ate 7 of it, so
24-x-7
Hope it helps