Learn Data Structures by Building the Merge Sort Algorithm - Step 11

Tell us what’s happening:

can someone tell me what’s wrong with my code? I’m stuck at this step 11 and can’t pass it

Your code so far

def merge_sort(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


# User Editable Region

    while left_array_index < len(left_part) and right_array_index < len(right_part) :
        pass

# 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/131.0.0.0 Safari/537.36 Edg/131.0.0.0

Challenge Information:

Learn Data Structures by Building the Merge Sort Algorithm - Step 11

Hi there and welcome to our community!

Just as I posted a couple of minutes ago in another thread, this code is correct except for the unnecessary space before the colon at the end of the while statement.

2 Likes

wow that was unexpected… thanks!!