
Asked in MindTickle
Ninja and His Meetings Problem Statement
Ninja has started a new startup with a single conference room available for meetings. Given an array/list MEETINGS
of consecutive appointment requests, Ninja must decide which meetings to accept. Since he requires a 15-minute break between meetings, he cannot accept consecutive requests.
The task is to figure out the maximum total booked minutes possible in the conference room for all meetings.
Example:
Input:
MEETINGS = [30, 15, 60]
Output:
90
Explanation:
Assuming meetings start at 12:00. The first meeting lasts for 30 minutes, ending at 12:30. Ninja requires a 15-minute break, rendering the next 15-minute meeting unfeasible. After resting, he can attend the subsequent 60-minute meeting. Thus, total booked minutes are 30 + 60 = 90.
Constraints:
1 <= T <= 102
1 <= N <= 5 * 103
0 <= MEETINGS[i] <= 105
andMEETINGS[i]
is a multiple of 15- Time Limit: 1 second
Input Format
The first line contains an integer ‘T’, indicating the number of test cases. Each test case consists of two parts:
An integer ‘N’ indicating the number of meetings.
N space-separated integers representing the duration of each meeting.
Output Format
For each test case, return the maximum number of minutes scheduled for meetings. Each result should be printed on a new line.
Note:
You are not required to print anything; just implement the function to return the answer.
Be the first one to answer
Add answer anonymously...
Top Software Developer Interview Questions Asked at MindTickle
Q. Design the Low-Level Design (LLD) for a Parking Lot.
Q. Trapping Rain Water Problem Statement You are given a long type array/list ARR o...read more
Q. Search in a Row-wise and Column-wise Sorted Matrix Problem Statement You are giv...read more
Interview Questions Asked to Software Developer at Other Companies
Top Skill-Based Questions for MindTickle Software Developer
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Java Interview Questions and Answers
250 Questions
SQL Interview Questions and Answers
250 Questions
Software Development Interview Questions and Answers
250 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

