human
Two equal sum segment range queries | Function to find the required prefix Sum.
Function to hash all the values of prefix Sum array in an unordered map.
Function to check if a range can be divided into two equal parts.
To store the value of Sum of entire range.
If value of Sum is odd.
To store p_arr [ l - 1 ].
If the value exists in the map.
Driver code.
prefix - Sum array.
Map to store the values of prefix - Sum.
Perform queries"
Solution in Python:

Give me a code to two equal sum segment range queries and the other steps required?
assistant
#Here is code to two equal sum segment range queries and the other steps required.
 def prefixSum ( p_arr , arr , n ) :
	p_arr [ 0 ] = arr [ 0 ]
	for i in range ( 1 , n ) :
		p_arr [ i ] = arr [ i ] + p_arr [ i - 1 ]
def hashPrefixSum ( p_arr , n , q ) :
	for i in range ( n ) :
		q [ p_arr [ i ] ] = 1
def canDivide ( p_arr , n , q , l , r ) :
	Sum = 0
	if ( l == 0 ) :
		Sum = p_arr [ r ]
	else :
		Sum = p_arr [ r ] - p_arr [ l - 1 ]
	if ( Sum % 2 == 1 ) :
		print ( " No " )
		return
	beg = 0
	if ( l != 0 ) :
		beg = p_arr [ l - 1 ]
	if ( beg + Sum // 2 in q . keys ( ) ) :
		print ( " Yes " )
	else :
		print ( " No " )
arr = [ 1 , 1 , 2 , 3 ]
n = len ( arr )
p_arr = [ 0 for i in range ( n ) ]
prefixSum ( p_arr , arr , n )
q = dict ( )
hashPrefixSum ( p_arr , n , q )
canDivide ( p_arr , n , q , 0 , 1 )
canDivide ( p_arr , n , q , 1 , 3 )
canDivide ( p_arr , n , q , 1 , 2 )