What is wrong with this code? I am getting the output on my machine but it is not accepting this as solution.

  • 0
    Select L.Num ConsicutiveNums From Logs L
    Join Logs L1 on L.Id = L1.Id+1
    Join Logs L2 on L.Id = L2.Id +2
    Where L.Num = L1.Num And L.Num = L2.Num

  • 0

    Maybe try Group by ConsicutiveNums?
    Cuz it might return more than one 1 if there are four 1 consecutive.
    BTW, there is a typo on your ConsecutiveNums. You did ConsicutiveNums.
    Hope this will help

Log in to reply

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