LeetCode solutions

3069. Change Data Type

My accepted Python solution to LeetCode problem 3069, Change Data Type, running in 273ms.

  • Difficulty: Easy
  • Python
  • Runtime 273ms
  • Memory 66.7MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 273ms, memory 66.7MB, accepted 2026-01-02.

python
import pandas as pd

def changeDatatype(students: pd.DataFrame) -> pd.DataFrame:
    students['grade'] = students['grade'].astype(int)
    return students

Source