Goal- Added logic to timesOverlap function in Util.js. The function takes an array of timeBlock objects. It returns true if there is a time conflict and false otherwrise.
Logic - Sort the array according to start times. Check if the next element start time is less than the current element end time. If this is the case, return true since there is an overlap. If not continue checking rest of the elements in the this manner. If an array of 1 or less objects is passed the function returns false without going into a loop since there is no time conflicts.
Goal- Added logic to timesOverlap function in Util.js. The function takes an array of timeBlock objects. It returns true if there is a time conflict and false otherwrise.
Logic - Sort the array according to start times. Check if the next element start time is less than the current element end time. If this is the case, return true since there is an overlap. If not continue checking rest of the elements in the this manner. If an array of 1 or less objects is passed the function returns false without going into a loop since there is no time conflicts.
Function Test Cases