BETA

Difficulty Level:

Medium

Total Submissions: 13074 Accuracy:

14.18%

Minimum Platforms

Given arrival and departure times of all trains that reach a railway station, find the minimum number of platforms required for the railway station so that no train waits.

Input:

First line will contain a number T, the number of test cases.
Each test case will contain a number N, the number of trains.
Next two lines will consist of N space separated time intervals denoting arrival and departure times respectively.
NOTE: Time intervals are in 24 hour format(hhmm),preceding zeros are insignificant.
Consider the example for better understanding of input.

Output:

Print the required answer in separated line.

Constraints:

1<=T<=80
1<=N<=5000

1<=A[i]<=5000

Example:

INPUT:

1

900  940 950  1100 1500 1800
910 1200 1120 1130 1900 2000

OUTPUT:

3

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.