2446. Determine if Two Events Have Conflict Easy
1/**
2 * [2446] Determine if Two Events Have Conflict
3 *
4 * You are given two arrays of strings that represent two inclusive events that happened on the same day, event1 and event2, where:
5 *
6 * event1 = [startTime1, endTime1] and
7 * event2 = [startTime2, endTime2].
8 *
9 * Event times are valid 24 hours format in the form of HH:MM.
10 * A conflict happens when two events have some non-empty intersection (i.e., some moment is common to both events).
11 * Return true if there is a conflict between two events. Otherwise, return false.
12 *
13 * <strong class="example">Example 1:
14 *
15 * Input: event1 = ["01:15","02:00"], event2 = ["02:00","03:00"]
16 * Output: true
17 * Explanation: The two events intersect at time 2:00.
18 *
19 * <strong class="example">Example 2:
20 *
21 * Input: event1 = ["01:00","02:00"], event2 = ["01:20","03:00"]
22 * Output: true
23 * Explanation: The two events intersect starting from 01:20 to 02:00.
24 *
25 * <strong class="example">Example 3:
26 *
27 * Input: event1 = ["10:00","11:00"], event2 = ["14:00","15:00"]
28 * Output: false
29 * Explanation: The two events do not intersect.
30 *
31 *
32 * Constraints:
33 *
34 * evnet1.length == event2.length == 2.
35 * event1[i].length == event2[i].length == 5
36 * startTime1 <= endTime1
37 * startTime2 <= endTime2
38 * All the event times follow the HH:MM format.
39 *
40 */
41pub struct Solution {}
42
43// problem: https://leetcode.com/problems/determine-if-two-events-have-conflict/
44// discuss: https://leetcode.com/problems/determine-if-two-events-have-conflict/discuss/?currentPage=1&orderBy=most_votes&query=
45
46// submission codes start here
47
48impl Solution {
49 pub fn have_conflict(event1: Vec<String>, event2: Vec<String>) -> bool {
50 false
51 }
52}
53
54// submission codes end
55
56#[cfg(test)]
57mod tests {
58 use super::*;
59
60 #[test]
61 fn test_2446() {
62 }
63}
64
Back
© 2025 bowen.ge All Rights Reserved.