Minimum Time To Solve The Problems

Given 'N' subjects, each containing a certain number of problems, and 'K' friends, assign subjects to friends such that each subject goes to exactly one friend, maintaining contiguity in assignment, aiming to minimize the maximum number of problems any single friend receives. Each problem takes 1 unit of time to solve. Determine the minimum possible time required for the most loaded friend.

Example:

Input:
 N = 4
K = 2
subjects = {50, 100, 300, 400}
Output:
400
Explanation:

The optimal assignment of subjects is {50, 100, 300} for the first friend and {400} for the second friend. The maximum time any friend takes in this setup is 400, which is minimal.

Constraints:

  • 1 <= T <= 10
  • 1 <= N, K <= 10^4
  • 1 <= subjects[i] <= 10^9
  • Time limit: 1 second
AnswerBot
4mo

Assign subjects to friends to minimize maximum workload, find minimum time for most loaded friend.

  • Assign subjects contiguously to minimize maximum workload

  • Determine the minimum possible time required ...read more

Help your peers!
Select
Add answer anonymously...

SPRINKLR Production Analyst interview questions & answers

A Production Analyst was asked Q. GUESSTIMATE PRODUCT DESING
A Production Analyst was asked Q. Minimum Time To Solve The Problems Given 'N' subjects, each containing a certain...read more
A Production Analyst was asked Q. Shortest Path in a Binary Matrix Problem Statement Given a binary matrix of size...read more

Popular interview questions of Production Analyst

A Production Analyst was asked Q1. GUESSTIMATE PRODUCT DESING
A Production Analyst was asked Q2. Minimum Time To Solve The Problems Given 'N' subjects, each containing a certain...read more
A Production Analyst was asked Q3. Shortest Path in a Binary Matrix Problem Statement Given a binary matrix of size...read more
SPRINKLR Production Analyst 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