diff --git "a/leetcode3/\353\263\200\354\247\200\355\230\221/v3/1401. Circle and Rectangle Overlapping.py" "b/leetcode3/\353\263\200\354\247\200\355\230\221/v3/1401. Circle and Rectangle Overlapping.py" new file mode 100644 index 00000000..932a79f0 --- /dev/null +++ "b/leetcode3/\353\263\200\354\247\200\355\230\221/v3/1401. Circle and Rectangle Overlapping.py" @@ -0,0 +1,20 @@ +''' +실패 +''' + +class Solution: + def checkOverlap(self, radius: int, xCenter: int, yCenter: int, x1: int, y1: int, x2: int, y2: int) -> bool: + st = set() + for x in range(x1,x2+1): + st.add((x,y1)) + st.add((x,y2)) + for y in range(y1,y2+1): + st.add((x1,y)) + st.add((x2,y)) + + while st: + x,y = st.pop() + if ((x-xCenter) ** 2 + (y-yCenter) ** 2) ** 0.5 <= radius: + return True + + return False