Files
LeetCode_tasks/solutions/lc1507.py
Vombit 801bafd8ba 6
2026-05-27 15:52:14 +05:00

9 lines
280 B
Python

class Solution:
def reformatDate(self, date: str) -> str:
month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
d = date.split(" ")
return f"{d[2]}-{month.index(d[1])+1:02}-{int(d[0][:-2]):02}"