Subset of a regular language, for each of whose words there exists an element with the same number of 1s in the other regular language For regular languages $A,B\subseteq\{0,1\}^*$, is

$$L_2 = \{x \in A \mid \exists y \in B : |x|_1 =|y|_1 \}$$

regular, where $|x|_1$  means the number of appearances of 1 in the word $x$?

i need to demonstrate $L_2$ automata.

Thought about using the multiplication automata, not so sure.
The idea is as follows:


We run two automata in parallel: one verifies that the input is in $A$, and the other verifies the other condition.
The second automaton simulates an automaton for $B$, in the following way. At any point in time it may simulate reading a $0$. It ignores all $0$s in the real input, and forwards all $1$s in the real input.


I'll let you construct an NFA given this description.