human
Calculate total wall area of houses painted | Function to find the total area of walls painted in N row - houses.
Stores total area of N row - houses that needs to be painted.
Traverse the array of wall heights.
Update total area painted.
Update total.
Traverse all the houses and print the shared walls.
Update total.
Print total area needs to paint.
Driver Code.
Given N , W & L.
Given heights of houses.
Function Call"
Solution in Python:

Write me a code to calculate total wall area of houses painted and the other steps required?
assistant
#Here is code to calculate total wall area of houses painted and the other steps required.
 def areaToPaint ( N , W , L , Heights ) :
	total = 0
	for i in range ( N ) :
		total += 2 * Heights [ i ] * W
	total += L * ( Heights [ 0 ] + Heights [ N - 1 ] )
	for i in range ( 1 , N ) :
		total += L * abs ( Heights [ i ] - Heights [ i - 1 ] )
	print ( total )
if __name__ == " _ _ main _ _ " :
	N = 7
	W = 1
	L = 1
	Heights = [ 4 , 3 , 1 , 2 , 3 , 4 , 2 ]
	areaToPaint ( N , W , L , Heights )