train takes 2 seconds to fully enter the tunnel it still takes one more second for the front of train to reach the exit....and another two seconds for the back of the train to exit the tunnel
let's say it is travelling at 100 m/s
2 seconds to enter fully = 2 s x 100m/s = 200m this is how long the train is
3 seconds later the back of the train travels 300 m and exits the tunnel tunnel length = 300 m
length of train / length of tunnel = 200/300 = 2/3