You can set up a system of equations for this problem. Let x = number of coach tickets and y = number of first class tickets. Then:
330x + 1220y = 12730 (cost of coach tickets plus cost of first class tickets is total budget)
x + y = 17 (number of coach tickets plus number of first class tickets is total number of people)
Solve the second equation for y to get y = 17 - x, then plug that into the first equation and solve for x:
330x + 1220(17 - x) = 12730
330x + 20740 - 1220x = 12730
-890x + 20740 = 12730
-890x = -8010
x = 9
Sarah bought x = 9 coach tickets. Plug that into the second equation and solve for y:
9 + y = 17
y = 8
Sarah bought y = 8 first class tickets.