"More than" or "no less than"??


  • 0
    C

    From the test case, I think it should be "no less than".


  • 0
    G

    I think the meaning in this problem is "no less than".
    Though the example given in this problem is more than 5 (actually 6), but the input given is 5. So when I wrote " > 5 " in code area, I got "wrong answer".
    It might be a tiny bug of this peoblem.
    Hoping this issue will be solved.


  • 0
    1

    In fact, this is a "no primary key" table ,so it is possible to have same line like “A - math” “A - math”;
    and in this case, you query should count 1 instead of 2.
    here is my query:

    select class
    from courses
    group by class
    having count(distinct student)>=5;


Log in to reply
 

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