Minimum Number of Railway Platforms

Minimum Hotel Rooms Required

Given two integer arrays arrivals and departures representing the check-in and check-out times of guests at a hotel, calculate the minimum number of rooms required to accommodate all guests. A room can be reused immediately if a guest checks out at the same time another guest checks in (e.g., a checkout at time 5 and a check-in at time 5 do not overlap). Constraints: 1 <= arrivals.length == departures.length <= 10^5 0 <= arrivals[i] < departures[i] <= 10^9 The input arrays are not necessarily sorted.
JavaSweep LineTwo-pointerSorting
00
Read

Minimum Number of Railway Platforms

Given two arrays representing the arrival and departure times of all trains reaching a station, calculate the minimum number of platforms required so that no train is kept waiting. Constraints and Details: All trains arrive and depart on the same day. Times are provided in 24-hour format (HHMM). If a train arrives at the same time another train departs, they cannot share the same platform; a separate platform is required for the arriving train. Input arrays Arrival and Departure are of size N. Example: Input: Arrival = [900, 940, 950, 1100, 1500, 1800], Departure = [910, 1200, 1120, 1130, 1900, 2000] Output: 3
C++Two-PointerGreedySorting
00
Read
1
InterviewGPT

AI-powered tools to help you succeed in tech interviews — from resume to offer.

Interview Solver

  • Coding Puzzles
  • System Design
  • Behavioral Challenges
  • ML System Design
  • SQL Puzzles
  • FE System Design
Explore Solver

Question Bank

  • Coding Interview Questions
  • System Design Interview Questions
  • Behavioral Interview Questions
  • ML System Design Questions
  • SQL & Database Questions
  • FE System Design Questions
Explore Questions

Golden Blogs

  • Coding Solutions
  • System Design Guides
  • Behavioral Guides
  • ML System Design Guides
  • SQL Solutions
  • FE System Design Guides
Explore Blogs

Intervipedia

  • Coding Concepts
  • System Design Concepts
  • Behavioral Concepts
  • ML System Concepts
  • SQL Concepts
  • FE System Concepts
Explore Concepts

Application Tools

  • Self-Intro Generator

Company

  • Pricing
  • FAQ
  • About
  • Privacy Policy
  • Terms of Service

© 2026 InterviewGPT Inc. All rights reserved.

All systems operationalUS-East

Made with ♥ for developers