What these types of problems want you to find is the least common multiple.
The LCM will be the product of the highest occurring primes of the numbers prime factorization.
12=2*2*3, 18=2*3*3
So the LCM is 2*2*3*3=36
So the lights will flash again at the same time 36 seconds after 8 pm, or if you prefer:
8:00:36