Student Attendance Record II | Recursion | Memoization | Bottom Up | Leetcode 552 | codestorywithMIK

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



Duration: 40:53
6,230 views
296


iPad PDF Notes - https://github.com/MAZHARMIK/Intervie...
Whatsapp Community Link : https://www.whatsapp.com/channel/0029...
This is the 96th Video of our Playlist "Dynamic Programming : Popular Interview Problems" by codestorywithMIK

In this video we will try to solve a very good DP Problem : Student Attendance Record II | Recursion | Memoization | Bottom Up | Easiest Explanation | Leetcode 552 | 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 : Student Attendance Record II | Recursion | Memoization | Bottom Up | Easiest Explanation | Leetcode 552 | codestorywithMIK
Company Tags : GOOGLE
My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Intervie...
Leetcode Link : https://leetcode.com/problems/student...


My DP Concepts Playlist :    • Roadmap for DP | How to Start DP ? | ...  
My Graph Concepts Playlist :    • Graph Concepts & Qns - 1 : Graph will...  
My Recursion Concepts Playlist :    • Introduction | Recursion Concepts And...  
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Intervie...
Instagram :   / codestorywithmik  
Facebook :   / 100090524295846  
Twitter :   / cswithmik  
Subscribe to my channel :    / @codestorywithmik  

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

Summary :
Approach-1: Using Recursion + Memoization
Description: Utilizes recursion to explore all possible attendance records, memoizing results to avoid redundant calculations. Tracks three states: number of days left (n), number of absences (absent), and consecutive lates (consecutive_late). Ensures that records with 2 or more absences or 3 consecutive lates are marked invalid. Memoization table stores computed results to achieve efficiency.
Time Complexity: O(n) with memoization.
Space Complexity: O(n) due to the recursion stack and memoization table.

Approach-2: Using Bottom-Up Dynamic Programming
Description: Transforms the recursive solution into an iterative one, using dynamic programming.
Uses a 3D DP table to store the number of valid records for each day, number of absences, and number of consecutive lates. Iteratively fills the DP table based on previous day’s values, ensuring all states are computed iteratively. Base cases are initialized to handle zero days.
Time Complexity: O(n) as each day’s states are computed once.
Space Complexity: O(n) for the DP table.

✨ Timelines✨
00:00 - Introduction
4:42 - Thought Process - Recursion + Memo
22:11 - Coding Recursion + Memo
26:17 - Bottom Up
35:56 - Coding Bottom Up

#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 #newyear2024




Other Videos By codestorywithMIK


2024-06-03Find Subarray With Bitwise AND Closest to K | Sliding Window | Leetcode 3171 | codestorywithMIK
2024-06-02We hit 50K ❤️🙏
2024-06-02Longest Palindrome | 3 Easy Approaches | Leetcode 409 | codestorywithMIK
2024-06-01Append Characters to String to Make Subsequence | Simple Approach | Leetcode 2486 | codestorywithMIK
2024-05-31Lexicographically Minimum String After Removing Stars | Easy | Leetcode 3170 | codestorywithMIK
2024-05-29Single Number III | Detailed Explanation | Leetcode 260 | codestorywithMIK
2024-05-28Count Triplets That Can Form Two Arrays of Equal XOR | Leetcode 1442 | codestorywithMIK
2024-05-27Number of Steps to Reduce a Number in Binary Representation to One | 2 Approaches | Leetcode 1404
2024-05-26Get Equal Substrings Within Budget | Classic Sliding Window | Leetcode 1208 | codestorywithMIK
2024-05-25Special Array With X Elements Greater Than or Equal X | 3 Approaches |Leetcode 1608|codestorywithMIK
2024-05-24Student Attendance Record II | Recursion | Memoization | Bottom Up | Leetcode 552 | codestorywithMIK
2024-05-07Relative Ranks | 3 Approaches | Leetcode 506 | codestorywithMIK
2024-05-07Double a Number Represented as a Linked List | 4 Approaches | Story|Leetcode 2816 | codestorywithMIK
2024-05-05Remove Nodes From Linked List | 3 Detailed Approaches | Story | Leetcode 2487 | codestorywithMIK
2024-05-04Thank you from the bottom of my heart ❤️🙏 #codestorywithmik
2024-05-02Compare Version Numbers | stringstream | StringTokenizer | C++ | JAVA |Leetcode 165|codestorywithMIK
2024-05-01Largest Positive Integer That Exists With Its Negative |4 Approaches|Leetcode 2441 |codestorywithMIK
2024-04-30Reverse Prefix of Word | Detail on reverse Function | Leetcode 2000 | codestorywithMIK
2024-04-29Number of Wonderful Substrings | Clear Intuition | Full Dry Run | Leetcode 1915 | codestorywithMIK
2024-04-29Minimum Number of Operations to Make Array XOR Equal to K | Easy | Leetcode 2997 | codestorywithMIK
2024-04-27Travel Mood 🌍 #codestorywithmik