leetcode 1507. Reformat Date
1 2 3 4 5 6 class Solution: def reformatDate(self, date: str) -> str: month=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] date=date.split() ans=date[2]+'-'+'%.2d'%(month.index(date[1])+1)+'-'+'%.2d'%(int(date[0][:-2])) return(ans) Colored by Color Scripter cs
2022. 4. 8.