LeetCode solutions

3065. Display the First Three Rows

My accepted Python solution to LeetCode problem 3065, Display the First Three Rows, running in 264ms.

  • Difficulty: Easy
  • Python
  • Runtime 264ms
  • Memory 66.5MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 264ms, memory 66.5MB, accepted 2026-01-02.

python
import pandas as pd

def selectFirstRows(employees: pd.DataFrame) -> pd.DataFrame:
    return employees.head(3)

Source