You are given a 0-indexed n x n integer matrix grid with values in the range [1, n^2]. Every integer appears exactly once except a, which appears twice, and b, which is missing.
Return a 0-indexed integer array ans of size 2 where ans[0] = a and ans[1] = b.