From 012acaba15defd2f37aeeec13b87a8ad061a1769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=97=BC=ED=98=9C=EC=A0=95?= <122238744+cyzlcyzl@users.noreply.github.com> Date: Mon, 12 Oct 2026 23:54:20 +0900 Subject: [PATCH] Create 4056. Number of Intersecting Interval Pairs I.java --- ...Number of Intersecting Interval Pairs I.java" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "leetcode3/\354\227\274\355\230\234\354\240\225/4056. Number of Intersecting Interval Pairs I.java" diff --git "a/leetcode3/\354\227\274\355\230\234\354\240\225/4056. Number of Intersecting Interval Pairs I.java" "b/leetcode3/\354\227\274\355\230\234\354\240\225/4056. Number of Intersecting Interval Pairs I.java" new file mode 100644 index 00000000..f32aae7d --- /dev/null +++ "b/leetcode3/\354\227\274\355\230\234\354\240\225/4056. Number of Intersecting Interval Pairs I.java" @@ -0,0 +1,16 @@ +class Solution { + public int countIntersections(int[][] intervals) { + int count = 0; + + for (int i = 0; i < intervals.length - 1; i++) { + for (int j = i + 1; j < intervals.length; j++) { + if (Math.max(intervals[i][0], intervals[j][0]) + <= Math.min(intervals[i][1], intervals[j][1])) { + count++; + } + } + } + + return count; + } +}