select distinct l1.Num as ConsecutiveNums
from Logs as l1,Logs as l2,Logs as l3
l2.Id = l1.Id+1 and l3.Id = l2.Id + 1
l1.Num=l2.Num and l3.Num = l2.Num;
same as you
select distinct a.Num from Logs a,Logs b,Logs c where a.Id = b.Id-1 and b.Id = c.Id-1 and a.Num = b.Num and b.Num = c.Num
but why my same query cannot pass for 'time limit exceeded'. LOL.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.