题目要求: 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]
转载请注明原文地址: https://mac.8miu.com/read-515692.html