Hey bro! It won't pass the execution time (12000 ms) for large numbers. Something like [(0, 20), (-100000000, 10), (30, 40)]
@wrttech4222 жыл бұрын
They made larger test cases shortly after I uploaded this video. You will need to use an algorithm with a better run time complexity
@pshiro2 жыл бұрын
I'm testing this kata, but now this kata has large tests and my code can't complete it because it takes more than 12 seconds. And I check your code in this kata, and it doesn't work either. P.S. My code: return len(set({i for a,b in intervals for i in range(a,b)}))
@wrttech4222 жыл бұрын
I will need to use a new algorithm with a better run time complexity.
@Vityk.4W Жыл бұрын
It don`t work for long intervals like this [(0, 25), (-999999999, 15), (52, 62)] # result is 100000034 .... out of memory ((
@lepuzki2 жыл бұрын
I made similar code but im trying to think of a better algorithm, its just too slow lol