Past passed solution now TLE

  • 0

    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
        (select a.Id, max(a.Name) as Name, max(a.Salary) as Salary, a.DepartmentId 
            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
        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.