Skip to content

Commit c8603d5

Browse files
Merge pull request #1930 from CodingTestStudy2/남효정
[남효정] Day30
2 parents 5420ac1 + e0a3197 commit c8603d5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 풀이 실패
2+
# 나이트는 1번 움직일 때마다 무조건 현재 칸과 다른 색의 칸으로 감
3+
# 따라서 짝수 번 움직이면 원래 색으로 돌아감
4+
# x + y 좌표 합의 홀짝으로 칸의 색상을 알 수 있음
5+
class Solution:
6+
def canReach(self, start: list[int], target: list[int]) -> bool:
7+
return (start[0] + start[1]) % 2 == (target[0] + target[1]) % 2

0 commit comments

Comments
 (0)