Your question is Find Missing Number in Array. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an array of integers nums containing n distinct numbers taken from 0 to n, find the one number that is missing from the array.
You must implement an algorithm that runs in O(n) time and uses O(n) space.
def missing_number(nums: list[int]) -> int: