프로그래머스 - 당구 연습 (L2)
🧠 Algorithm
1def solution(m, n, startX, startY, balls): 2 answer = [] 3 for bx, by in balls: 4 tmp = [] 5 for x, y in [(-1*startX, startY), (startX, -1*startY), (startX, 2*n-startY), (2*m-startX, startY)]: 6 if bx==x and (y < 0 < by < startY or startY < by < n < y): 7 continue 8 if by==y and (x < 0 < bx < startX or startX < bx < m < x): 9 continue 10 tmp.