Skip to content

Commit 0488f2a

Browse files
authored
Create 3996. Even Number of Knight Moves.py
1 parent 611937e commit 0488f2a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def canReach(self, start: list[int], target: list[int]) -> bool:
3+
start_parity = (start[0]+start[1])%2
4+
target_paritiy = (target[0]+target[1])%2
5+
6+
if start_parity == target_paritiy:
7+
return True
8+
else:
9+
return False

0 commit comments

Comments
 (0)