Unique Paths II | Recursion | Memo | Bottom Up | Leetcode 63 | DP On Grids | codestorywithMIK
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