2446. Determine if Two Events Have Conflict ¶ Time: $O(1)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: bool haveConflict(vector<string>& event1, vector<string>& event2) { return event1[0] <= event2[1] && event2[0] <= event1[1]; } }; 1 2 3 4 5class Solution { public boolean haveConflict(String[] event1, String[] event2) { return event1[0].compareTo(event2[1]) <= 0 && event2[0].compareTo(event1[1]) <= 0; } } 1