Amar and Balu can use $f$ such that $f$ assigns different values to consecutive numbers ie they only need $2$ distinct elements in the range of $f$, example of one such function is $f : U \rightarrow \{0, 1\}, f(x) = x \text{ mod } 2$.
Balu will say Chaya gave same numbers to both of them if the output received from Amar and the output calculated by using his own input are same, otherwise he'll say Chaya gave them numbers that differ by $1$.
$\therefore$ the smallest value of $n$ is $1$.
Answer – A.