Hi Manasa, I think the issue with your code is with your `cHeap` and `jHeap` and how they're used. Since `cHeap` & `jHeap` are sorted by end time, when you do a `peak()` you get the last activity with the largest end-time so far. The tasks you're processing from `oPQ` are however sorted by start time, this can result in a situation where temp is an activity which is before the activity on cHeap / jHeap (i.e. start & end of temp < start & end of heap), however it wont get assigned because you check for condition `temp.start > slotC.end`.
In my opinion instead of doing a `cHeap.peek()` you should look at and compare the current value assigned to slotC which should be the last activity assigned to C but in order of start time, same should be applicable to `jHeap.peak()`. As the problem statement states, On Thursday, April 9, 2020 at 2:26:09 AM UTC+5:30, MANASA wrote: > > Hi, >>> >> I agree with the two points that you have mentioned. > The strange part though is I had taken care of both the points > during the submission, the sample testcase was working fine, and also other > testcases that I tried on my IDE. > But on submission, I got "WA". > It would be a great help if you could shed some light on the > issue with the code. > https://github.com/Manasa01/ToDebug.git > -- 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/596ea4e6-f156-4f2a-bcb7-d09202ec63b0%40googlegroups.com.
