Warm greetings to the codeforces community,
Found the following problem statement on internet :
---Problem statement starts---
Your app uses a 3rd party video player. The VP has the functionalities – play, pause, seek, close. On close, the VP component makes a callback to your app. It passes the below params on close – a) total length of the video in seconds b) array of VideoPart objects, where each VideoPart {startTime; endTime;}. VideoPart denotes continuous part of the video that was watched withuot any disturbance due to pause or seek. Sequence of VP objects in the array, is the same sequence as he watched the video parts.
Sample Input:
60, [{0, 60}] 60, [{0, 30}, {30, 60}]
return a int value(0, 1) denoting the user has watched the entire video or not.
---Problem statement ends here---
One way of solving this problem that came to my mind is using hashmaps. Is there a better way of solving this problem with a better time and space complexity? Please do let me know in the comments. Thanks in advance.