def my_func(arr):
    length = len(arr)
    start = 0
    end = length - 1
    count = 0
    while start < end:
        if arr[start] != arr[end]:
            res = arr[start] + arr[end]
            arr[start], arr[end] = res, res
            count += 1
        start += 1
        end -= 1
        print(arr)
    return count


ls = [1, 4, 5, 9, 1]
print(my_func(ls))

aa935bf15f6e65788df652611c6661da79022139
<mask token>

def my_func(arr):
    length = len(arr)
    start = 0
    end = length - 1
    count = 0
    while start < end:
        if arr[start] != arr[end]:
            res = arr[start] + arr[end]
            arr[start], arr[end] = res, res
            count += 1
        start += 1
        end -= 1
        print(arr)
    return count


<mask token>

def my_func(arr):
    length = len(arr)
    start = 0
    end = length - 1
    count = 0
    while start < end:
        if arr[start] != arr[end]:
            res = arr[start] + arr[end]
            arr[start], arr[end] = res, res
            count += 1
        start += 1
        end -= 1
        print(arr)
    return count


<mask token>
print(my_func(ls))

def my_func(arr):
    length = len(arr)
    start = 0
    end = length - 1
    count = 0
    while start < end:
        if arr[start] != arr[end]:
            res = arr[start] + arr[end]
            arr[start], arr[end] = res, res
            count += 1
        start += 1
        end -= 1
        print(arr)
    return count


ls = [1, 4, 5, 9, 1]
print(my_func(ls))
