Since First Come First Served policy is used, total seeks is given by: $(20-10)+(22-10)+(22-20)+(20-2)+(40-2)+(40-6)+(x-6)$
As time for one seek is 6 ms, total time taken is: $[(20-10)+(22-10)+(22-20)+(20-2)+(40-2)+(40-6)+(x-6)]*6$
Given that total seek time is 876 ms. So, we can write:
$[(20-10)+(22-10)+(22-20)+(20-2)+(40-2)+(40-6)+(x-6)]*6=876 \implies 108+x =146 \implies x=38$