leetcode 1164 python

mac2026-08-19  1

题目要求: https://leetcode-cn.com/problems/day-of-the-year/ python中strptime函数的用法: https://www.runoob.com/python/att-time-strptime.html

import time class Solution: def dayOfYear(self, date: str) -> int: return time.strptime(date, "%Y-%m-%d")[-2]
最新回复(0)