Railway Station Codevita 9 Solution

Railway Station TCS Codevita 9 Solution 2020

Problem Description

Given timetable of trains and their stoppage time at a Railway Station, discover least number of stages required. 

Note – 

In the event that Train A’s flight time is x and Train B’s appearance time is x, at that point we can’t oblige Train B on a similar stage as Train A. 


1 <= N <= 10^5 

0 <= a <= 86400 

0 < b <= 86400 

Number of stages > 0 


First line contains N signifying number of trains. 

Next N line contain 2 whole numbers, an and b, indicating the appearance time and stoppage season of train. 


Single whole number indicating the base quantities of stages expected to oblige each train. 

Time Limit 


Model 1 


10 2 

5 10 

13 5 



The soonest showing up train at time t = 5 will show up at platform# 1. Since it will remain there till t = 15, train showing up at time t = 10 will show up at platform# 2. Since it will withdraw at time t = 12, train showing up at time t = 13 will show up at platform# 2. 

Railroad Station


Codevita Season 9 All Questions Solutions

Leave a Comment