+ 1
Guys some can help me with this problem .
This is a qus from Google code jam please help me find issues with my current code. https://www.sololearn.com/post/299354/?ref=app
7 Respuestas
+ 2
HITANSH DOSHI You made a point....
But even if sort list you still have to compare it with starting time,
And it got me thinking that,
How will differentiate between 150
because it could mean 1:50 or 15:00...?🤔
+ 1
Hopes, This might help....
You are only checking with only starting time not ending time....
Instead,
You should compare with both starting as well as ending time.....
As ending time is always greater then starting time, so there is no need to sort.....
https://code.sololearn.com/cF55OpgDZCU9/?ref=app
+ 1
Ty for your precious time to help me
I used sort to sort the list in order of starting time
So I will only need to check with ending time
your solution is working 👍 for sample input
Except for this
1
5
99 150
1 100
100 301
2 5
150 250
For each case you will need to go through whole list to check if it intersecting with another time slot or not as it is not sorted
+ 1
Oh.... I didn't read last line..... 😅
But, look at it...
I still think you need it compare with start time too...
Because,
1
4
100 300 -> c
150 400 -> j
200 500 -> impossible as neither c or j are free
300 700
Please correct me if i am wrong..... 🙏
+ 1
Ok
So
For c end time will be 300
And j end time will be 400
If a task have start time less then this it is impossible
I used this logic
Lemme know if I am missing something
+ 1
Yep that's what i am trying to say, if they aren't free how can they do another task.....
0
They have mentioned in problem that given time is in min after 00:00
thanks DeWill for helping
I will try that