Unbelievably simply solution


  • 0
    6
    SELECT DISTINCT
        l.Num Num
    FROM
        Logs l, Logs l1, Logs l2
    WHERE
        l.Id = l1.Id + 1
    AND
        l1.Id = l2.Id + 1
    AND
        l.Num = l1.Num
    AND
        l2.Num = l1.Num

  • 3
    B

    i have wrote the same sql just like you.
    but i think it's the right answer just to this question.
    what if the condition is more than 5 or 10 time?


Log in to reply
 

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