You are given a list of integers. Write a function to find the longest subarray with the same sum of elements at both ends. Return the subarray's length.
Example:
Input:
[1, 2, 3, 0, 5, 7, 0]
Output:
4
Make sure you return your solution, don't print!
AI
Bot
Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.