Learn
Since we’ve only technically depleted one of our two inputs to merge()
, we want to add in the rest of the values to finish off our merge()
function and return the sorted list.
Instructions
1.
After our while
loop, check if there are any elements still in left
.
If there are, add those elements to the end of result
.
2.
After checking for elements in left
let’s check if there are elements in right
. If there are, add them to result
.
Sign up to start coding
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.