Skip to content

Commit ebc8580

Browse files
Merge pull request #2121 from CodingTestStudy2/변지협
[변지협] 2026/10/03
2 parents c29a374 + 053f269 commit ebc8580

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'''
2+
실패
3+
'''
4+
5+
class Solution:
6+
def checkOverlap(self, radius: int, xCenter: int, yCenter: int, x1: int, y1: int, x2: int, y2: int) -> bool:
7+
st = set()
8+
for x in range(x1,x2+1):
9+
st.add((x,y1))
10+
st.add((x,y2))
11+
for y in range(y1,y2+1):
12+
st.add((x1,y))
13+
st.add((x2,y))
14+
15+
while st:
16+
x,y = st.pop()
17+
if ((x-xCenter) ** 2 + (y-yCenter) ** 2) ** 0.5 <= radius:
18+
return True
19+
20+
return False

0 commit comments

Comments
 (0)