Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Function Implementation to Pass Tests

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Function Implementation to Pass Tests. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Guidewire PolicyCenter schedules policy review windows that may overlap. Given the start and end times for each window, return the minimum number of reviewers required so every review can occur on time.

Treat each window as half-open, [start, end): a reviewer whose window ends at time t can immediately handle another window starting at t.

Formal Specification

Implement minimum_reviewers(windows). The input is a list of integer pairs, where windows[i] = [start, end] and start < end. Return an integer representing the maximum number of simultaneously active review windows.

Constraints

  • 0 <= windows.length <= 10^5
  • 0 <= start < end <= 10^9
  • Each window contains exactly two integers
  • Return 0 for an empty input

Function Signature

def minimum_reviewers(windows):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output