I have one list like as
[15/05/2019 10:01]
[15/05/2019 10:03]
[15/05/2019 10:05]
[15/05/2019 10:09]
[15/05/2019 10:11]
[15/05/2019 10:19]
[15/05/2019 10:22]
[15/05/2019 10:28]
[15/05/2019 10:30]
[15/05/2019 10:35]
[15/05/2019 10:38]
[15/05/2019 10:42]
[15/05/2019 10:45]
[15/05/2019 10:55]
[15/05/2019 11:01]
[15/05/2019 11:11]
[15/05/2019 11:18]
[15/05/2019 11:25]
[15/05/2019 11:29]
[15/05/2019 11:41]
I have another list
[StartTime=15/05/2019 10:08,EndTime=15/05/2019 10:28]
[StartTime=15/05/2019 10:42,EndTime=15/05/2019 10:48]
[StartTime=15/05/2019 11:20,EndTime=15/05/2019 11:26]
result
[StartTime=15/05/2019 10:01,EndTime=15/05/2019 10:05]
[StartTime=15/05/2019 10:30,EndTime=15/05/2019 10:38]
[StartTime=15/05/2019 10:55,EndTime=15/05/2019 11:18]
[StartTime=15/05/2019 11:29,EndTime=15/05/2019 11:41]
if it's possible to get the start and end time using LINQ or for loop
For ex: 1) select 1st item in second list
[StartTime=15/05/2019 10:08,EndTime=15/05/2019 10:28]
and check below timings in the first list that needs to be a result like
[15/05/2019 10:01]
[15/05/2019 10:03]
[15/05/2019 10:05]
now considered StartTime as [15/05/2019 10:01] and EndTime as [15/05/2019 10:05]
2) now Considered 2nd list again, and select the second item
[StartTime=15/05/2019 10:42,EndTime=15/05/2019 10:48]
and check below timings in the second list first end time to second list 2nd starttime, that need to be a result like
[15/05/2019 10:30]
[15/05/2019 10:35]
[15/05/2019 10:38]
now considered StartTime as [15/05/2019 10:30] and EndTime as [15/05/2019 10:38]..
Similarly, we follow the next steps.
Thanks