Given an array of sequential numbers where one number is missing and one number is duplicated, find the missing number.
Implement find_missing_number(nums). The array contains values from 1 through n, where n is the array length. Return the missing integer. The input may be unordered, and the solution should run in O(n) time.
Example: [1, 2, 4, 4] returns 3.
def find_missing_number(nums):