Pandas Simple Solution
Intuition\n Describe your first thoughts on how to solve this problem. \nEasy Solution you will understand once you see the code\n\n# Approach\n Describe your a
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nEasy Solution you will understand once you see the code\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nimport pandas as pd\n\ndef department_highest_salary(employee: pd.DataFrame, department: pd.DataFrame) -> pd.DataFrame:\n    if employee.empty or department.empty:\n        return pd.DataFrame(columns=[\'Department\', \'Employee\', \'Salary\'])\n\n    # Merge the employee and department DataFrames on \'departmentId\' and \'id\' columns\n    merged_df = employee.merge(department, left_on=\'departmentId\', right_on=\'id\', suffixes= (\'_employee\', \'_department\'))\n\n    # Find the maximum salary in each department\n    max_salaries = merged_df.groupby(\'departmentId\')[\'salary\'].transform(\'max\')\n\n    # Filter for employees with maximum salary in each department\n    highest_salary_df = merged_df[merged_df[\'salary\'] == max_salaries]\n\n    # Select the required columns\n    result_df = highest_salary_df[[\'name_department\', \'name_employee\', \'salary\']]\n\n    # Rename the columns as specified\n    result_df.columns = [\'Department\', \'Employee\', \'Salary\']\n\n    return result_df\n\n\n```
['Pandas']