LeetCode/0213_House_robber2.py
def max_profit(dp):
            """
            This function finds the max profit by robbing the adjacent houses using DP
            Input:- DP array of size n-1
            Output:- Max profit from that DP array
            """
            len_dp = len( dp )
            dp[1] = max( dp[0], dp[1] )
            for k in range( 2, len_dp ):
                dp[k] = max( dp[k - 1], dp[k] + dp[k - 2] )
    
            return dp[-1]

            This function finds the max profit by robbing the adjacent houses using DP
            Input:- DP array of size n-1
            Output:- Max profit from that DP array
            
This function finds the max profit by robbing the adjacent houses using DP
Input:- DP array of size n-1
Output:- Max profit from that DP array
This function finds the max profit by robbing the adjacent houses using DP Input : - DP array of size n - 1 Output : - Max profit from that DP array
def max_profit(dp):
            len_dp = len( dp )
            dp[1] = max( dp[0], dp[1] )
            for k in range( 2, len_dp ):
                dp[k] = max( dp[k - 1], dp[k] + dp[k - 2] )
            return dp[-1]
def max_profit ( dp ) : len_dp = len ( dp ) dp [ 1 ] = max ( dp [ 0 ] , dp [ 1 ] ) for k in range ( 2 , len_dp ) : dp [ k ] = max ( dp [ k - 1 ] , dp [ k ] + dp [ k - 2 ] ) return dp [ - 1 ]
This function finds the max profit by robbing the adjacent houses using DP
Input:- DP array of size n-1
Output:- Max profit from that DP array
This function finds the max profit by robbing the adjacent houses using DP Input : - DP array of size n - 1 Output : - Max profit from that DP array
"""
            This function finds the max profit by robbing the adjacent houses using DP
            Input:- DP array of size n-1
            Output:- Max profit from that DP array
            """
dp