human
Maximum score assigned to a subsequence of numerically consecutive and distinct array elements | ''Function to find the maximum score possible.
'' Base Case.
'' If previously occurred  subproblem occurred.
'' Check if lastpicked element differs  by 1 from the current element.
'' Calculate score by including  the current element.
'' Calculate score by excluding  the current element.
'' Return maximum score from  the two possibilities.
''Function to print maximum score.
'' DP array to store results.
'' Function call.
''Driver Code.
'' Given arrays.
'' Function Call"
Solution in Python:
assistant
#Here is code to maximum score assigned to a subsequence of numerically consecutive and distinct array elements and the other steps required.
 def maximumSum ( a , b , n , index , lastpicked , dp ) :
	if ( index == n ) :
		return 0
	if ( dp [ index ] [ lastpicked + 1 ] != - 1 ) :
		return dp [ index ] [ lastpicked + 1 ]
	option1 , option2 = 0 , 0
	if ( lastpicked == - 1 or a [ lastpicked ] != a [ index ] ) :
		option1 = ( b [ index ] + maximumSum ( a , b , n , index + 1 , index , dp ) )
	option2 = maximumSum ( a , b , n , index + 1 , lastpicked , dp )
	dp [ index ] [ lastpicked + 1 ] = max ( option1 , option2 )
	return dp [ index ] [ lastpicked + 1 ]
def maximumPoints ( arr , brr , n ) :
	index = 0
	lastPicked = - 1
	dp = [ [ - 1 for x in range ( n + 5 ) ] for y in range ( n + 5 ) ]
	print ( maximumSum ( arr , brr , n , index , lastPicked , dp ) )
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 2 , 3 , 3 , 3 , 1 ]
	brr = [ - 1 , 2 , 10 , 20 , - 10 , - 9 ]
	N = len ( arr )
	maximumPoints ( arr , brr , N )