Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you do this problem in JavaScript (Node.js)? Overview You are given a set of meeting start times and duration. You will determine if there

Can you do this problem in JavaScript (Node.js)?
image text in transcribed
image text in transcribed
Overview You are given a set of meeting start times and duration. You will determine if there is a meeting conflict, and also the number of conflicts and total conflict time. A conflict in this case is defined as a time overlap between two meetings. For instance (assuming military time format 00002400 ), if: - meeting A begins at 0800 and it's duration is 45min - meeting B begins at 0830 and it's duration is 30min Then it is easy to tell that there is indeed a meeting conflict between A and B. The number of conflicts is 1. (Note that meeting A conflicts with meeting B> implies that meeting B conflicts with meeting A. So we count this only once!) Finally the total conflict time here is 15min. Also note that the time slots are exclusive and not inclusive of the time. For instance if meeting B began at 0845 instead, then there is no conflict. Function Description Complete the function conflictinfo in the editor below. conflictinfo has the following parameter(s): meetings[meetings[0],..meetings[n-1]]: an array of strings where each string has the format: time>, where > has the military time format: HHMM has the integer format in minutes If any constraints are not followed, then you return "error". Else if you find a conflict you need to return a string that has the format: conflict, ,> If you find there is no conflict, you need to return a string that simply says: good Constraints - All times are in military time format (described above) - All durations are integers in range [0..90] and are in minutes only. - Range comparison is exclusive and not inclusive (described above) - 2400 is the same as 0000 - Meeting conflicts between any pair of meetings are counted only once Return "error" if any constraints are not followed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions