Maximum Number of Points From Grid Queries | DFS | BFS | Optimal | Leetcode 2503 | codestorywithMIK

Whatsapp Community Link : https://www.whatsapp.com/channel/0029... Hi Everyone, this is the 148th video of our Playlist "Arrays 1D/2D : Popular Interview Problems". Now we will be solving a good 2d-array problem based - Maximum Number of Points From Grid Queries | DFS | BFS | Optimal | Detailed | Leetcode 2503 | codestorywithMIK We will do brute force so that it will help us to analyse the redundant work we are doing in order to further optimise the solution. Focus on the thought process, it will help you build your logic. Problem Name : Maximum Number of Points From Grid Queries | DFS | BFS | Optimal | Detailed | Leetcode 2503 | codestorywithMIK Company Tags : will update later Code Github(C++ & JAVA) - https://github.com/MAZHARMIK/Intervie... Leetcode Link : https://leetcode.com/problems/maximum... My DP Concepts Playlist :    • Roadmap for DP | How to Start DP ? | Topic...   My Graph Concepts Playlist :    • Graph Concepts & Qns - 1 : Graph will no m...   My Segment Tree Concepts Playlist :    • Segment Tree | Introduction | Basics | Bui...   My Recursion Concepts Playlist :    • Introduction | Recursion Concepts And Ques...   Trie Playlist -    • Word Search II | Leetcode 212 | Detailed |...   Difference Array Technique: Concepts & Qns :    • Introduction | What | How | Difference Arr...   My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Intervie... Instagram :   / codestorywithmik   Facebook :   / 100090524295846   Twitter :   / cswithmik   Subscribe to my channel :    / @codestorywithmik   ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗ ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣ ╠╗║╚╝║║╠╗║╚╣║║║║║═╣ ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝ Video Summary : Approach-1 (BFS - Brute Force): For each query, we perform a BFS traversal starting from the top-left corner and count how many cells can be reached with a value less than the query value. It repeatedly explores level by level but redoes the same work for every query, leading to inefficiency. Approach-2 (DFS - Brute Force): Similar to the BFS approach but uses recursive DFS to explore all possible paths from the start cell for each query. It counts reachable cells with a value smaller than the query but, again, recalculates everything from scratch for each query. Approach-3 (Optimal - Min Heap + Sorting): This approach sorts the queries and uses a min-heap to expand reachable cells only once in increasing order of their grid values. As each query arrives, it continues expanding from where it left off, avoiding repeated computations and making the process efficient. ✨ Timelines✨ 00:00 - Introduction 0:26 - Motivation 0:51 - Problem Explanation 5:41 - Brute Force Thought Process 7:49 - Coding Using BFS 13:04 - Coding Using DFS 16:22 - Optimal Approach Thought Process 31:28 - Complete Dry Run 40:18 - Coding Optimal Approach #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

Count of Interesting Subarrays | Using Studied Concept | Dry Run | Leetcode 2845 | codestorywithMIK
▶︎

Count of Interesting Subarrays | Using Studied Concept | Dry Run | Leetcode 2845 | codestorywithMIK

Maximum Number of Points From Grid Queries - Leetcode 2503 - Python
▶︎

Maximum Number of Points From Grid Queries - Leetcode 2503 - Python

Argentinien – Schweiz Highlights | Viertelfinale, FIFA WM 2026 | sportstudio
▶︎

Argentinien – Schweiz Highlights | Viertelfinale, FIFA WM 2026 | sportstudio

Remove All Adjacent Duplicates In String | Stack Interview Question
▶︎

Remove All Adjacent Duplicates In String | Stack Interview Question

Should You Still Study Math in the AI Era? – Grant Sanderson (@3Blue1Brown )
▶︎

Should You Still Study Math in the AI Era? – Grant Sanderson (@3Blue1Brown )

Find the Safest Path in a Grid - LeetCode 2812 (Optimal Approach Explained)
▶︎

Find the Safest Path in a Grid - LeetCode 2812 (Optimal Approach Explained)

Count Subarrays With Majority Element I and II | 5 Approaches | Leetcode 3737 and 3739 | MIK
▶︎

Count Subarrays With Majority Element I and II | 5 Approaches | Leetcode 3737 and 3739 | MIK

Norwegen – England Highlights | Viertelfinale, FIFA WM 2026 | sportstudio
▶︎

Norwegen – England Highlights | Viertelfinale, FIFA WM 2026 | sportstudio

Minimum Window Substring - Airbnb Interview Question - Leetcode 76
▶︎

Minimum Window Substring - Airbnb Interview Question - Leetcode 76

The Big Short (2015): The Jenga Scene – Explaining the Financial Collapse
▶︎

The Big Short (2015): The Jenga Scene – Explaining the Financial Collapse

Build a Complete Medical Chatbot with LLMs, LangChain, Pinecone, Flask & AWS 🔥
▶︎

Build a Complete Medical Chatbot with LLMs, LangChain, Pinecone, Flask & AWS 🔥

Argentina vs. Switzerland Highlights FIFA World Cup 2026 | Sportschau
▶︎

Argentina vs. Switzerland Highlights FIFA World Cup 2026 | Sportschau

Maximum Score From Grid Operations | Super Detailed For Beginners | Leetcode 3225 | codestorywithMIK
▶︎

Maximum Score From Grid Operations | Super Detailed For Beginners | Leetcode 3225 | codestorywithMIK

A Jane Street Software Engineering Mock Interview with Grace and Nolen
▶︎

A Jane Street Software Engineering Mock Interview with Grace and Nolen

The World's Most Important Machine
▶︎

The World's Most Important Machine

40Hz Binaural Gamma Waves - Ultra Deep Concentration
▶︎

40Hz Binaural Gamma Waves - Ultra Deep Concentration

The Dirty AI lie : How the GREATEST bet in human history started to crack in June 2026?
▶︎

The Dirty AI lie : How the GREATEST bet in human history started to crack in June 2026?

The 5-Step DP Formula That Solves Any Problem !
▶︎

The 5-Step DP Formula That Solves Any Problem !

We're 99.9% sure this pattern is true, but no one can prove it
▶︎

We're 99.9% sure this pattern is true, but no one can prove it

How To Learn So Fast It’s Almost Unfair
▶︎

How To Learn So Fast It’s Almost Unfair