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 and MEETINGS[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:
  1. An integer ‘N’ indicating the number of meetings.
  2. 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.
AnswerBot
4mo

Find the maximum total booked minutes possible in a conference room for given meeting durations with a 15-minute break between meetings.

  • Iterate through the list of meeting durations and calculate the ...read more

Help your peers!
Select
Add answer anonymously...

Atlassian Software Developer Intern interview questions & answers

A Software Developer Intern was asked Q. Design an API service to limit the number of accesses for a user to a function w...read more
A Software Developer Intern was asked 12mo agoQ. Longest increasing subsequence
A Software Developer Intern was asked Q. Ninja and Geometry Problem Statement In this problem, Ninja is provided with two...read more

Popular interview questions of Software Developer Intern

A Software Developer Intern was asked Q1. Design an API service to limit the number of accesses for a user to a function w...read more
A Software Developer Intern was asked 12mo agoQ2. Longest increasing subsequence
A Software Developer Intern was asked Q3. Ninja and Geometry Problem Statement In this problem, Ninja is provided with two...read more
Atlassian Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits