Terry had $620 more than Sam. Sam gave $340 to Terry. Sam's money was 1/14 as much as Terry in the end. How much money did Sam have in the end?

Sam's amount --- x

Terry's ----------- x + 620

after gifting:
Sam ---- x - 340
Terry ----- x+620 + 340 = x + 960

x - 340 = (1/14)(x + 960)
14x - 4750 = x + 960
13x = 5720
x = 440

Sam now has x-340 = 100
(Terry now has 1400 , which means Sam has 1/14 of what Terry has)