Watch out the key word: consecutively!!! Here is my solution.


  • 1
    A
    select distinct a.Num from Logs a 
    inner join Logs b on a.id = b.id+1 
    inner join Logs c on a.id = c.id+2
    where a.Num = b.Num and a.Num = c.Num

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.