Minimum Sum of Values by Dividing Array | Recursion | Memoization | Leetcode 3117 | codestorywithMIK
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A This is the 91st Video of our Playlist "Dynamic Programming: Popular Interview Problems". In this video we will try to solve a good Practice Problem on Binary Tree : Minimum Sum of Values by Dividing Array | Recursion | Memoization | Detailed | Leetcode 3117 | 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 : Minimum Sum of Values by Dividing Array | Recursion | Memoization | Detailed | Leetcode 3117 | codestorywithMIK Company Tags : Will update soon My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/DP/Minimum%20Sum%20of%20Values%20by%20Dividing%20Array.cpp Leetcode Link : https://leetcode.com/problems/minimum-sum-of-values-by-dividing-array/ My DP Concepts Playlist : https://youtu.be/7eLMOE1jnls My Graph Concepts Playlist : https://youtu.be/5JGiZnr6B5w My Recursion Concepts Playlist : https://www.youtube.com/watch?v=pfb1Zduesi8&list=PLpIkg8OmuX-IBcXsfITH5ql0Lqci1MYPM 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 : https://www.youtube.com/@codestorywithMIK Summary : This code defines a class `Solution` with a method `minimumValueSum` that takes two vectors of integers, `nums` and `andValues`, as input. It calculates the minimum value sum based on certain conditions involving bitwise AND operations. The method initializes some variables and a dynamic programming array `dp`. It recursively calculates the minimum value using a helper function `solve`, which employs memoization through the `dp` array to optimize performance. The `minimumValueSum` function sets up the initial conditions and calls the `helper` function to compute the result. It returns -1 if the result exceeds a certain limit, otherwise, it returns the computed minimum value sum. The initial value of `AndVal` is set to `(1 left shift 17)-1`, which is a bitwise representation of a value with all bits set to 1. This choice ensures that the initial value doesn't impact the first number's bitwise AND operation. ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗ ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣ ╠╗║╚╝║║╠╗║╚╣║║║║║═╣ ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝ ✨ Timelines✨ 00:00 - Introduction #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
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.