Unique Paths II | Recursion | Memo | Bottom Up | Leetcode 63 | DP On Grids | codestorywithMIK

Subscribers:
92,300
Published on ● Video Link: https://www.youtube.com/watch?v=9RUpue4oMx4



Duration: 0:00
893 views
43


Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
This is the 32nd Video of our Playlist "DP Concepts & Qns" by codestorywithMIK

We already covered the introduction of DP On Grids in video-29 and video-30 of this playlist.
Video-29 - Part-1 -    • Introduction | DP On Grids | Part 1 |...  
Video-30 - Part-2 -    • Introduction | DP On Grids | Part 2 |...  

We have already solved Unique Paths I -    • Unique Paths | Recursion | Memo | Bot...  
Today we will be solving similar Medium and popular problem based on Grid DP - Unique Paths II | Recursion | Memo | Bottom Up | Leetcode 63 | DP On Grids | codestorywithMIK
We will solve it using Recursion and Memoization and then we will convert that to Bottom Up.


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 : Unique Paths II | Recursion | Memo | Bottom Up | Leetcode 63 | DP On Grids | codestorywithMIK
Company Tags : Amazon, Cisco, Walmart
My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/DP/DP on Grids/Unique Paths II.cpp
Leetcode Link : https://leetcode.com/problems/unique-paths-ii/description/


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 :
Approach 1: Recursion + Memoization

Description:
This approach uses recursion to explore all possible paths from the top-left to the bottom-right corner.
To avoid redundant calculations, a memoization table (t[i][j]) is used to store the number of unique paths from cell (i,j) to the destination.
The recursive function stops when it encounters an obstacle or goes out of bounds, and it returns 1 when the bottom-right corner is reached.
Approach 2: Bottom-Up Dynamic Programming

Description:
This approach uses a tabular (iterative) method to build a DP table (t[i][j]) from the top-left corner to the bottom-right corner.
The first row and column are initialized based on whether obstacles block the path.
For each cell (i,j), if it's not an obstacle, the number of paths is the sum of paths from the top (t[i-1][j]) and left (t[i][j-1]) cells.

✨ Timelines✨
00:00 - Introduction
0:09 - Motivation
0:46 - Problem Explanation
3:14 - Thought Process Recursion & Memoization
13:10 - Coding Recursion & Memoization
16:56 - Understanding Bottom Up in Detail
33:39 - Corner Case
40:06 - Coding bottom 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




Other Videos By codestorywithMIK


2025-01-05Shifting Letters II | Leetcode 2381 | Difference Array Technique: Concepts & Questions - 2 | MIK
2025-01-04Introduction | What | How | Difference Array Technique: Concepts & Questions - 1 | codestorywithMIK
2025-01-02But bhai….
2025-01-02Number of Ways to Split Array | Simple Thought Process | Leetcode 2270 | codestorywithMIK
2025-01-02Maximum Non Negative Product in a Matrix | Recursion | Memo | Bottom Up | Leetcode 1594 |DP On Grids
2025-01-01Count Vowel Strings in Ranges | Simple Thought Process | Leetcode 2559 | codestorywithMIK
2024-12-312025 Placement Roadmap | How I Would Have Prepared | Year 2025 Special | Happy New Year
2024-12-31What is special about year 2025 ?
2024-12-27Maximum Sum of 3 Non-Overlapping Subarrays | Detailed For Beginners | Leetcode 689 | codstorywithMIK
2024-12-26Best Sightseeing Pair | 3 Approaches | Detailed For Beginners | Leetcode 1014 | codestorywithMIK
2024-12-26Unique Paths II | Recursion | Memo | Bottom Up | Leetcode 63 | DP On Grids | codestorywithMIK
2024-12-25Target Sum | Two Ways Of Memoization | Detailed | Leetcode 494 | Explanation + Code
2024-12-24Find Building Where Alice and Bob Can Meet | Segment Tree Concepts & Qns | Video 11 | Leetcode 2940
2024-12-24Range Maximum Index Query | Part 2 | Segment Tree Concepts & Qns | Video 10 | codestorywithMIK
2024-12-24Find Minimum Diameter After Merging Two Trees | Leetcode 3203 | Graph Concepts & Qns - 45 | MIK
2024-12-24Diameter Of Undirected Graph | Tree Diameter | Leetcode 1245 | Graph Concepts & Qns - 44 | MIK
2024-12-23Range Maximum Index Query | Part 1 | Segment Tree Concepts & Qns | Video 9 | codestorywithMIK
2024-12-23Thank You For The Trust 🙏❤️🥺
2024-12-23Minimum Number of Operations to Sort a Binary Tree by Level | Leetcode 2471 | codestorywithMIK
2024-12-19Reverse Odd Levels of Binary Tree | Detailed | DFS | BFS | Leetcode 2415 | codestorywithMIK
2024-12-19Max Chunks To Make Sorted | 3 Detailed Approaches | Leetcode 769 | codestorywithMIK