From a6e602378df8163ba0843c4f90c5e21a172e896c Mon Sep 17 00:00:00 2001 From: Qiming Xu <458173774@qq.com> Date: Wed, 24 Jan 2024 00:30:28 +0000 Subject: [PATCH] leetcode: finished #858 --- content/leetcode/2024/1.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/content/leetcode/2024/1.md b/content/leetcode/2024/1.md index 576fad02..31da9b80 100644 --- a/content/leetcode/2024/1.md +++ b/content/leetcode/2024/1.md @@ -3,6 +3,27 @@ title: 2024.1 draft: false --- +# 2024.1.24 + +```python +# +# @lc app=leetcode.cn id=858 lang=python3 +# +# [858] 镜面反射 +# + + +# @lc code=start +class Solution: + def mirrorReflection(self, p: int, q: int) -> int: + while p % 2 == 0 and q % 2 == 0: + p, q = p // 2, q // 2 + return 1 - p % 2 + q % 2 + + +# @lc code=end +``` + # 2024.1.23 ```python