The electrons ofย two atoms Y and Z are arranged in shells as shown above. The…