human
Absolute difference between floor of Array sum divided by X and floor sum of every Array element when divided by X | Function to find absolute difference between the two sum values.
Variable to store total sum.
Variable to store sum of A [ i ] / X.
Traverse the array.
Update totalSum.
Update perElementSum.
Floor of total sum divided by X.
Return the absolute difference.
Driver Code.
Input.
Size of Array.
Function call to find absolute difference between the two sum values"
Solution in Python:
 Write me a code to absolute difference between floor of Array sum divided by X and floor sum of every Array element when divided by X and the other steps required?
assistant
#Here is code to absolute difference between floor of Array sum divided by X and floor sum of every Array element when divided by X and the other steps required.
 def floorDifference ( A , N , X ) :
	totalSum = 0
	perElementSum = 0
	for i in range ( N ) :
		totalSum += A [ i ]
		perElementSum += A [ i ] // X
	totalFloorSum = totalSum // X
	return abs ( totalFloorSum - perElementSum )
if __name__ == ' _ _ main _ _ ' :
	A = [ 1 , 2 , 3 , 4 , 5 , 6 ]
	X = 4
	N = len ( A )
	print ( floorDifference ( A , N , X ) )