Expressing DTFTs in terms of one another with similar time domain signals
The problem is asking you to find an analytical expression given $x_1[n]$ and $x_2[n]$. There is no need to compute anything, let alone code it up!
The problem wants you to identify that given the discrete-time domain functions, you use properties of the DTFT to write $X_2(e^{j\omega})$ in terms of $X_1(e^{j\omega})$. You've already identified that $x_2[n]$ contains a shifted version of $x_1[n]$.
You can use the time-shift property which says that if the DTFT of $x[n]$ is $X(e^{j\omega})$ then
$$\mathcal{F}(x[n - m]) = e^{-j\omega m}X(e^{j\omega})$$
Keeping in mind how the domain of $x_2[n]$ is defined, you can use the DTFT properties to express $X_2(e^{j\omega})$ in terms of $X_1(e^{j\omega})$.