Another method utilizes prefix sums and hashing. This technique begins with calculating the prefix sum, which is then stored along with the indices in a dictionary. If the overall sum of the array is even, we look for half of that sum in the dictionary. Here is a Python code example: def equal_sum_partition ( arr ) : total_sum = sum ( arr ) if total_sum % 2 != 0 : return "It's not possible to divide the array into two parts with equal sum as the total sum is odd" prefix_sum = 0 sum_dict = { } for i in range ( len ( arr ) ) : prefix_sum += arr [ i ] sum_dict [ prefix_sum ] = i if total_sum / 2 in sum_dict : partition_index = sum_dict [ total_sum / 2 ] return arr [ : partition_index + 1 ] , arr [ partition_index + 1 : ] equal_sum_partition ( [ 1 , 2 , 3 , 4 , 1 , 2 , 3 , 4 ] ) # Output: ([1, 2, 3, 4], [1, 2, 3, 4]) In this code, a dictionary is employed to keep track of the prefix sum at every step along with the corresponding index. We then verify if half of the overall sum is present in the dictionary. If it is, we retrieve the index from the dictionary and divide the array at that point.