Ambident nucleophiles are nucleophiles having two nucleophilic sites. Thus, ambident nucleophiles have two sites through which they can attack. For example, nitrite ion is an ambident nucleophile.
Nitrite ions can attack through oxygen resulting in the formation of alkyl nitrites. Also, it can attack through nitrogen resulting in the formation of nitroalkanes.
In the given reaction sequence, the structure of Y would be: