Find Missing and Repeated Values

An n x n grid contains integers from 1 to n^2. Each number should appear exactly once, but one number appears twice while another is missing. Find which number is repeated and which is missing, returning them as [repeated, missing].

Examples
Input: [[1,3],[2,2]]
Output: [2,4]
Hints

Find Missing and Repeated Values

An `n x n` grid contains integers from `1` to `n^2`. Each number should appear exactly once, but one number appears twice while another is missing. Find which number is repeated and which is missing, returning them as `[repeated, missing]`.