Another way:
Since the sum is 350, it should be a multiple of 10. As we have only 7 and 77 in the series, we can write it as
x * 7 + y * 77 = 350.
77 = 7 * 11
as 7 and 11 are both prime numbers, sum can be 350 when the x + y is a multiple of 10.
check the answers.
Only possible solution is 40.