My Calendar I 🔥🔥| Leetcode June Challenge | Leetcode 729 | Code + Approach | C++ | Hindi

preview_player
Показать описание

Please like, share and subscribe if you found the video useful. Feel free to ask in comments section if you have any doubts. :)

#leetcode
#leetcodeJuneChallenge
#interviewpreparation
My Calendar I solution
My Calendar I Leetcode
My Calendar I C++
My Calendar I C++ Hindi
My Calendar I Hindi

Checkout the series: 🔥🔥🔥
LIKE | SHARE | SUBSCRIBE 🔥🔥😊
Рекомендации по теме
Комментарии
Автор

You explain really well, mene aur bhi video dekhe isi question ke regarding but your explanation was so good, thank you so much for this video and please keep making such content, it is really helpful

surajusrethepersonal
Автор

Mam, you are applying brute force(rather it is acceptable). It can be optimized further by using set and upper_bound as:-

class MyCalendar {
private:
set<pair<int, int>> s;
public:
MyCalendar() {
}
bool book(int start, int end) {
auto it=s.upper_bound({start, end});
if(it!=s.end() && it->second<end) return false;
s.insert({end, start});
return true;
}
};

ishantgoyal
Автор

this is abrute force, instead use maps in c++

apoorvkrishan
Автор

mem hamne yaha vector of pair ko privately kyu declare Kiya he

mihirsinghsolanki
join shbcf.ru