Implement the Merge Sort Algorithm - Step 24

Tell us what’s happening:

heyyy, i can’t pass step 24, somebody help me pleaseee

Your code so far

def merge_sort(array):
    if len(array) <= 1:
        return array
    
    middle_point = len(array) // 2
    left_part = array[:middle_point]
    right_part = array[middle_point:]

    merge_sort(left_part)
    merge_sort(right_part)

    left_array_index = 0
    right_array_index = 0
    sorted_index = 0

    while left_array_index < len(left_part) and right_array_index < len(right_part):
        if left_part[left_array_index] < right_part[right_array_index]:
            array[sorted_index] = left_part[left_array_index]
            left_array_index += 1
        else:
            array[sorted_index] = right_part[right_array_index]
            right_array_index += 1
        sorted_index += 1

    while left_array_index < len(left_part):
        array[sorted_index] = left_part[left_array_index]
        left_array_index += 1
        sorted_index += 1
    
    while right_array_index < len(right_part):
        array[sorted_index] = right_part[right_array_index]
        right_array_index += 1
        sorted_index += 1

    return array


# User Editable Region
if __name__ == '__main__':
    numbers = [4, 10, 6, 14, 2, 1, 8, 5]
    print('Unsorted array:')
    print(numbers)
    print(merge_sort(numbers))

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0

Challenge Information:

Implement the Merge Sort Algorithm - Step 24

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-merge-sort/6569c1aeecaf95e25a3e2573.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @mribaspaiva,

You are not asked to print the function call.

Happy coding

can you explain for me pleasee, that is what the step order

The step asks you to call the merge_sort function and pass numbers as an argument. The step does not ask you to print that function call.

merge_sort(numbers)

you mean should write this

You should try it and see. Does it make sense to you?