• 문제 링크
Rectangle Overlap - LeetCode
Can you solve this real interview question? Rectangle Overlap - An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner. Its top
leetcode.com
• 풀이 코드
public class Solution {
public boolean isRectangleOverlap(int[] rec1, int[] rec2) {
return !(rec1[2] <= rec2[0] || rec1[0] >= rec2[2] || rec1[3] <= rec2[1] || rec1[1] >= rec2[3]);
}
}'Problem Solving > LeetCode' 카테고리의 다른 글
| [LeetCode] 859. Buddy Strings - Java (0) | 2026.10.26 |
|---|---|
| [LeetCode] 844. Backspace String Compare - Java (0) | 2026.10.25 |
| [LeetCode] 832. Flipping an Image - Java (0) | 2026.10.23 |
| [LeetCode] 830. Positions of Large Groups - Java (0) | 2026.10.23 |
| [LeetCode] 824. Goat Latin - Java (0) | 2026.10.21 |
댓글