Ad
Arrays
Data Types

The function calendarFunc() takes input of two people's schedules of the day in the form of int arrays. (Eg. {0900,1300,1440,1540,1820,1910} denoting the person is busy from 9am-1pm, 2:40-3:40pm, 6:20-7:10pm) It finds the overlaps in their schedules and outputs at most three blocks of free time that they both have in common.

import java.util.*;


public class Main<Integer> implements CalendarFunc<Integer> {
	ArrayList<Integer> PersonA = new ArrayList<Integer>();
	ArrayList<Integer> PersonB = new ArrayList<Integer>();
	ArrayList<Integer> BusyTime = new ArrayList<Integer>();
	ArrayList<Integer> FreeTime = new ArrayList<Integer>();
	
	public Main(ArrayList<Integer> PersonA, ArrayList<Integer> PersonB) {
		this.PersonA = PersonA;
		this.PersonB = PersonB;
		
	}
	@Override
	public void removeSleepTime() {
		// TODO removes sleeping blocks in FreeTime ArrayList
		
	}

	@Override
	public void findUnion() {
		// TODO return BusyTime, which is a union of all busy blocks
		
	}
	


}