Can you try the following case? 1 2 0900 0930 0930 1000
The expected result should be 2. Because the 1st train departs at 9:30 and the 2nd train arrives at the same time, so you need at least 2 platform. P.S. This is a group very specific to Google Code Jam. Please refrain from asking questions about problems that are not related to Google Code Jam. Problem Link : > https://practice.geeksforgeeks.org/problems/minimum-platforms/0/?track=md-arrays&batchId=144 > > My Code: > > #code > def minimumPlatforms(a,b,n): > a.sort() > b.sort() > platform = 1 > result = 1 > i = 1 > j = 0 > while(i<n and j<n): > if(a[i]<b[j]): > platform += 1 > i += 1 > if(platform > result): > result = platform > else: > platform -= 1 > j += 1 > return result > for _ in range(int(input())): > n = int(input()) > a = [int(x) for x in input().strip().split()] > b = [int(x) for x in input().strip().split()] > print(minimumPlatforms(a,b,n)) > > > I can't get my mistake. It gives proper output for sample test cases but > gives wrong output while I submit the code. > I request everyone to please find it. > I attach screenshots of output. > -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/e193c120-89e2-4f4e-ad51-7e8c3558d1f1%40googlegroups.com.
