So why does sound travel faster in solids and liquids than in gases?
Imagine a Newton's cradle. The end ball moves away 'almost' instantaneously, when the first ball is hit. This is like a solid - no gaps - just very resilient balls (molecules)
Now imagine a cradle with spaces between the balls. This is like molecules in a gas.
Say you left one ball out and spaced them out to cover the same distance as the first cradle- for a fair test.
After an impact, each ball would move away ' instantaneously' but would have to travel, at the same speed as the original ball, across the gap to the next ball - then the next ball would move away. It would take longer for the impact to transmit from one end to the other along the cradle with the spaces because of the time to move across the gaps.
That's an analogy - Continuous line of balls - solid: line of balls with gaps - gas.