Past passed solution now TLE


  • 0
    D

    This solution has passed on OJ before, but now I get TLE. Did OJ change the run time requirement?

    # Write your MySQL query statement below
    select t2.Name as Department, t1.Name as Employee, t1.Salary
    from
        (select a.Id, max(a.Name) as Name, max(a.Salary) as Salary, a.DepartmentId 
        from 
            Employee a
        left outer join
            Employee b
        on a.DepartmentId = b.DepartmentId and a.Salary<b.Salary
        group by a.Id, a.DepartmentID
        having count(distinct b.Salary)<=2
        )t1
    join
        Department t2
    on t1.DepartmentID=t2.Id
    order by t2.Name, t1.Salary desc;

Log in to reply
 

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