the way you convert from c++ to java to python is great.. people who get the idea and go away miss a priceless show.. XD
@KnowledgeCenter4 жыл бұрын
😂
@sudhirshinde20364 жыл бұрын
A small suggestion:) we could have used only vector sorted, as we will not require the endpoint of the interval anywhere in the binary search, btw thanks for the daily videos!
@KnowledgeCenter4 жыл бұрын
Good point!
@crankyinmv4 жыл бұрын
Thanks as always. I had the idea to sort and store the original indices, but didn;t think to follow up with a binary search. A possible optimization would be cache by endpoint.
@RishiRaj-dl1mg4 жыл бұрын
Sir i didn't get the last part of binary search...how did sorted[l] is returned at the end . Can you please explain?
@0anant04 жыл бұрын
Thanks! Can we use a hashmap: interval -> ori idx (as you have mentioned), and then save all intervals to a TreeMap/TreeSet and then use ceiling(end_time) for each interval?