diff --git a/data/progress.txt b/data/progress.txt index d6b1f8b1..8f66dc17 100644 --- a/data/progress.txt +++ b/data/progress.txt @@ -1,4 +1,4 @@ -20240310: 213,217,226,230,235,238,242 +20240310: 213,217,226,230,235,238,242,252 20240309: 207(again!!!),208,211(again),212 20240308: 152,153(again),190,191,198,200,206(again) 20240307: 139(again),141,143(again) diff --git a/data/to_review.txt b/data/to_review.txt index f3531518..b8b3c5ee 100644 --- a/data/to_review.txt +++ b/data/to_review.txt @@ -1,4 +1,4 @@ -2024-05-04 -> ['213,217,226,230,235,238,242'] +2024-05-04 -> ['213,217,226,230,235,238,242,252'] 2024-05-03 -> ['207(again!!!),208,211(again),212'] 2024-05-02 -> ['152,153(again),190,191,198,200,206(again)'] 2024-05-01 -> ['139(again),141,143(again)'] @@ -9,7 +9,7 @@ 2024-04-24 -> ['39,48(again),49,53,54'] 2024-04-23 -> ['20,21,23,33(again)'] 2024-04-22 -> ['1,3,5,4,19'] -2024-04-13 -> ['213,217,226,230,235,238,242'] +2024-04-13 -> ['213,217,226,230,235,238,242,252'] 2024-04-12 -> ['207(again!!!),208,211(again),212'] 2024-04-11 -> ['152,153(again),190,191,198,200,206(again)'] 2024-04-10 -> ['139(again),141,143(again)'] @@ -20,7 +20,7 @@ 2024-04-03 -> ['39,48(again),49,53,54'] 2024-04-02 -> ['20,21,23,33(again)'] 2024-04-01 -> ['1,3,5,4,19'] -2024-03-31 -> ['213,217,226,230,235,238,242'] +2024-03-31 -> ['213,217,226,230,235,238,242,252'] 2024-03-30 -> ['207(again!!!),208,211(again),212'] 2024-03-29 -> ['152,153(again),190,191,198,200,206(again)'] 2024-03-28 -> ['139(again),141,143(again)'] @@ -28,19 +28,19 @@ 2024-03-26 -> ['100,102,104,105(again)'] 2024-03-25 -> ['73,76,79(again),91,25'] 2024-03-24 -> ['55(again),56,62,70'] -2024-03-23 -> ['213,217,226,230,235,238,242'] +2024-03-23 -> ['213,217,226,230,235,238,242,252'] 2024-03-22 -> ['207(again!!!),208,211(again),212'] 2024-03-21 -> ['152,153(again),190,191,198,200,206(again)', '39,48(again),49,53,54'] 2024-03-20 -> ['139(again),141,143(again)', '20,21,23,33(again)'] 2024-03-19 -> ['121,124(again),125,128,133(again)', '1,3,5,4,19'] -2024-03-18 -> ['213,217,226,230,235,238,242', '100,102,104,105(again)'] +2024-03-18 -> ['213,217,226,230,235,238,242,252', '100,102,104,105(again)'] 2024-03-17 -> ['207(again!!!),208,211(again),212', '73,76,79(again),91,25'] 2024-03-16 -> ['152,153(again),190,191,198,200,206(again)', '55(again),56,62,70'] -2024-03-15 -> ['213,217,226,230,235,238,242', '139(again),141,143(again)'] +2024-03-15 -> ['213,217,226,230,235,238,242,252', '139(again),141,143(again)'] 2024-03-14 -> ['207(again!!!),208,211(again),212', '121,124(again),125,128,133(again)'] -2024-03-13 -> ['213,217,226,230,235,238,242', '152,153(again),190,191,198,200,206(again)', '100,102,104,105(again)', '39,48(again),49,53,54'] -2024-03-12 -> ['213,217,226,230,235,238,242', '207(again!!!),208,211(again),212', '139(again),141,143(again)', '73,76,79(again),91,25', '20,21,23,33(again)'] -2024-03-11 -> ['213,217,226,230,235,238,242', '207(again!!!),208,211(again),212', '152,153(again),190,191,198,200,206(again)', '121,124(again),125,128,133(again)', '55(again),56,62,70', '1,3,5,4,19'] +2024-03-13 -> ['213,217,226,230,235,238,242,252', '152,153(again),190,191,198,200,206(again)', '100,102,104,105(again)', '39,48(again),49,53,54'] +2024-03-12 -> ['213,217,226,230,235,238,242,252', '207(again!!!),208,211(again),212', '139(again),141,143(again)', '73,76,79(again),91,25', '20,21,23,33(again)'] +2024-03-11 -> ['213,217,226,230,235,238,242,252', '207(again!!!),208,211(again),212', '152,153(again),190,191,198,200,206(again)', '121,124(again),125,128,133(again)', '55(again),56,62,70', '1,3,5,4,19'] 2024-03-10 -> ['207(again!!!),208,211(again),212', '152,153(again),190,191,198,200,206(again)', '139(again),141,143(again)', '100,102,104,105(again)'] 2024-03-09 -> ['152,153(again),190,191,198,200,206(again)', '139(again),141,143(again)', '121,124(again),125,128,133(again)', '73,76,79(again),91,25'] 2024-03-08 -> ['139(again),141,143(again)', '121,124(again),125,128,133(again)', '100,102,104,105(again)', '55(again),56,62,70', '39,48(again),49,53,54'] diff --git a/leetcode_java/src/main/java/LeetCodeJava/Sort/MeetingRooms.java b/leetcode_java/src/main/java/LeetCodeJava/Sort/MeetingRooms.java index 0763f9d2..061c5dee 100644 --- a/leetcode_java/src/main/java/LeetCodeJava/Sort/MeetingRooms.java +++ b/leetcode_java/src/main/java/LeetCodeJava/Sort/MeetingRooms.java @@ -6,7 +6,24 @@ public class MeetingRooms { + // V0 + // IDEA : SORT + // https://github.com/yennanliu/CS_basics/blob/master/leetcode_python/Sort/meeting-rooms.py public boolean canAttendMeetings(int[][] intervals) { + // SORT ON 1st element (idx = 0) + Arrays.sort(intervals, (a, b) -> Integer.compare(a[0], b[0])); + // NOTE !!! start from idx=1 + for (int i = 1; i < intervals.length; i++) { + if (intervals[i-1][1] > intervals[i][0]) { + return false; + } + } + return true; + } + + // V1 + // IDEA : SORT + public boolean canAttendMeetings_(int[][] intervals) { // sort //Arrays.sort(intervals, Comparator.comparingInt((x, y) -> x[0] - y[0]).reversed()); @@ -38,11 +55,11 @@ public boolean canAttendMeetings(int[][] intervals) { return true; } - // V1 + // V2 // IDEA : BRUTE FORCE // https://leetcode.com/problems/meeting-rooms/editorial/ - // V1 + // V3 // IDEA : SORTING // https://leetcode.com/problems/meeting-rooms/editorial/ public boolean canAttendMeetings_2(int[][] intervals) { diff --git a/leetcode_java/src/main/java/LeetCodeJava/String/ValidAnagram.java b/leetcode_java/src/main/java/LeetCodeJava/String/ValidAnagram.java index 149c80ba..52e55fd3 100644 --- a/leetcode_java/src/main/java/LeetCodeJava/String/ValidAnagram.java +++ b/leetcode_java/src/main/java/LeetCodeJava/String/ValidAnagram.java @@ -78,5 +78,5 @@ public boolean isAnagram_2(String s, String t) { return true; } - + }