human
Array range queries over range queries | Function to execute type 1 query.
incrementing the array by 1 for type 1 queries.
Function to execute type 2 query.
If the query is of type 1 function call to type 1 query.
If the query is of type 2 recursive call to type 2 query.
Input size of array amd number of queries.
Build query matrix.
Perform queries.
printing the result"
How can the above be solved in Python?
 What is a code to array range queries over range queries and the other steps required?
assistant
#Here is code to array range queries over range queries and the other steps required.
 def type1 ( arr , start , limit ) :
	for i in range ( start , limit + 1 ) :
		arr [ i ] += 1
def type2 ( arr , query , start , limit ) :
	for i in range ( start , limit + 1 ) :
		if ( query [ i ] [ 0 ] == 1 ) :
			type1 ( arr , query [ i ] [ 1 ] , query [ i ] [ 2 ] )
		elif ( query [ i ] [ 0 ] == 2 ) :
			type2 ( arr , query , query [ i ] [ 1 ] , query [ i ] [ 2 ] )
n = 5
m = 5
arr = [ 0 for i in range ( n + 1 ) ]
temp = [ 1 , 1 , 2 , 1 , 4 , 5 , 2 , 1 , 2 , 2 , 1 , 3 , 2 , 3 , 4 ]
query = [ [ 0 for i in range ( 3 ) ] for j in range ( 6 ) ]
j = 0
for i in range ( 1 , m + 1 ) :
	query [ i ] [ 0 ] = temp [ j ]
	j += 1
	query [ i ] [ 1 ] = temp [ j ]
	j += 1
	query [ i ] [ 2 ] = temp [ j ]
	j += 1
for i in range ( 1 , m + 1 ) :
	if ( query [ i ] [ 0 ] == 1 ) :
		type1 ( arr , query [ i ] [ 1 ] , query [ i ] [ 2 ] )
	elif ( query [ i ] [ 0 ] == 2 ) :
		type2 ( arr , query , query [ i ] [ 1 ] , query [ i ] [ 2 ] )
for i in range ( 1 , n + 1 ) :
	print ( arr [ i ] , end = " ▁ " )