Maximum Water Trapped between two buckets
Asked in the First round stage. Given an array of non-negative integers heights, where each value represents the height of a bucket wall, return the maximum water that can be trapped between any two buckets.
Implement max_water_trapped(heights) and return the maximum area formed by choosing two indices i < j, where area is min(heights[i], heights[j]) * (j - i).
def max_water_trapped(heights):