2022.01.03-synchronized实现
2022/1/4 6:08:59
本文主要是介绍2022.01.03-synchronized实现,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
面试题:synchronized实现
参考链接
https://xiaomi-info.github.io/2020/03/24/synchronized/
https://www.cnblogs.com/aspirant/p/11470858.html
每日一题
1185. 一周中的第几天
class Solution: def dayOfTheWeek(self, day: int, month: int, year: int) -> str: d = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] m = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30] res = 0 cur = 1970 while cur < year: res += 365 if cur % 4 == 0 and cur % 100 != 0 or cur % 400 == 0: res += 1 cur += 1 if cur % 4 == 0 and cur % 100 != 0 or cur % 400 == 0: m[2] = 29 res += sum(m[:month]) + day return d[(res + 3) % 7]
这篇关于2022.01.03-synchronized实现的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-28pyqt 怎么打包整个项目-icode9专业技术文章分享
- 2024-09-28laravel Commands 创建带有参数的 Artisan 命令的步骤和示例-icode9专业技术文章分享
- 2024-09-28antd怎么实现渲染tiff图片-icode9专业技术文章分享
- 2024-09-28英文半角中划线和中文全角的中划线有什么区别-icode9专业技术文章分享
- 2024-09-28nvm npm 和node 他们之间有什么关系-icode9专业技术文章分享
- 2024-09-28Node Version Manager (nvm)使用教程-icode9专业技术文章分享
- 2024-09-28nvm命令太慢,是什么原因-icode9专业技术文章分享
- 2024-09-28Kotlin 如何增加、删除和修改 MutableStateFlow 中的值。-icode9专业技术文章分享
- 2024-09-28Kotlin的stateFlow.update 写法介绍-icode9专业技术文章分享
- 2024-09-28kotlin 怎么获取当前时间格式-icode9专业技术文章分享