Find Building Where Alice and Bob Can Meet | Segment Tree Concepts & Qns | Video 11 | Leetcode 2940
iPad PDF NOTES - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad PDF Notes/Range Maximum Index Query - Segment Tree.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
This is the 11th Video of our Playlist "Segment Tree Concepts & Qns" by codestorywithMIK
We already covered Part-1 and Part-2 in Video-9 and Video-10
Video-9 - Range Maximum Index Query | Part 1 - • Range Maximum Index Query | Part 1 | ...
Video-10 - Range Maximum Index Query | Part 2 - • Range Maximum Index Query | Part 2 | ...
In this video we will apply the concepts we learned in Video-9 and Video-10 and solve - Find Building Where Alice and Bob Can Meet | Segment Tree Concepts & Qns | Video 11 | Leetcode 2940 | codestorywithMIK
I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY.
We will do live coding after explanation and see if we are able to pass all the test cases.
Also, please note that my Github solution link below contains both C++ as well as JAVA code.
Problem Name : Find Building Where Alice and Bob Can Meet | Segment Tree Concepts & Qns | Video 11 | Leetcode 2940 | codestorywithMIK
Company Tags : will update later
My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Segment Tree/Find Building Where Alice and Bob Can Meet.cpp
Leetcode Link : https://leetcode.com/problems/find-building-where-alice-and-bob-can-meet
My DP Concepts Playlist : • Roadmap for DP | How to Start DP ? | ...
My Graph Concepts Playlist : • Graph Concepts & Qns - 1 : Graph will...
My Segment Tree Concepts Playlist : • Segment Tree | Introduction | Basics ...
My Recursion Concepts Playlist : • Introduction | Recursion Concepts And...
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
Subscribe to my channel : / @codestorywithmik
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
Video Summary :
The solution uses a Segment Tree to efficiently handle queries about finding the leftmost building taller than a given height.
Segment Tree:
Stores indices of maximum heights for ranges.
Built in O(n) and queried in O(logn).
Query Processing:
For each query [a,b], if the height at b is taller than or equal to a, return b.
Otherwise, perform a binary search on [b+1,n−1], using the segment tree to find the leftmost taller building.
Result:
Returns the index of the building or -1 if none exists.
✨ Timelines✨
00:00 - Introduction
0:33 - Motivation
1:27 - Problem Explanation
9:13 - Thought Process using concept we learned in video-9 and video-10
18:53 - Code it up
#MIK #mik #Mik
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #coding #programming #100daysofcode #developers #techjobs #datastructures #algorithms #webdevelopment #softwareengineering #computerscience #pythoncoding #codinglife #coderlife #javascript #datascience #leetcode #leetcodesolutions #leetcodedailychallenge #codinginterview #interviewprep #technicalinterview #interviewtips #interviewquestions #codingchallenges #interviewready #dsa #hindi #india #hindicoding #hindiprogramming #hindiexplanation #hindidevelopers #hinditech #hindilearning #helpajobseeker #jobseekers #jobsearchtips #careergoals #careerdevelopment #jobhunt #jobinterview #github #designthinking #learningtogether #growthmindset #digitalcontent #techcontent #socialmediagrowth #contentcreation #instagramreels #videomarketing #codestorywithmik #codestorywithmick #codestorywithmikc #codestorywitmik #codestorywthmik #codstorywithmik #codestorywihmik #codestorywithmiik #codeistorywithmik #codestorywithmk #codestorywitmick #codestorymik #codestorwithmik