Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String [] args){
- //Test Case 1
- checkAppts(10,10,11,11);
- //Test Case 2
- checkAppts(10,12,15,17);
- //Test Case 3
- checkAppts(13,10,14,14);
- }
- private static void checkAppts(int start1, int start2, int end1, int end2){
- int start;
- int end;
- if(start1 > start2)
- start = start1;
- else
- start = start2;
- if(end1 < end2)
- end = end1;
- else
- end = end2;
- if(start < end)
- System.out.println("Appts overlap");
- else
- System.out.println("Appts Dont Overlap");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement