First find set $A$.
$$ |(|x-3|-3)|\le1 $$
This gives
$$ -1\le |x-3|-3 \le1 $$
Adding $3$ throughout,
$$ 2\le |x-3|\le4 $$
So,
$$ |x-3|=2,3,4 $$
Corresponding integer values:
$$ |x-3|=2 \Rightarrow x=1,5 $$ $$ |x-3|=3 \Rightarrow x=0,6 $$ $$ |x-3|=4 \Rightarrow x=-1,7 $$
Hence,
$$ A=\{-1,0,1,5,6,7\},\quad |A|=6 $$
Now find set $B$.
Given
$$ \frac{(x-2)(x-4)}{x-1}\log_e(|x-2|)=0 $$
Product is zero when at least one factor is zero.
Case 1:
$$ \log_e(|x-2|)=0 $$
$$ |x-2|=1 \Rightarrow x=1,3 $$
But $x=1$ is excluded, so $x=3$ is valid.
Case 2:
$$ (x-2)(x-4)=0 \Rightarrow x=2,4 $$
$x=2$ is excluded, so $x=4$ is valid.
Thus,
$$ B=\{3,4\},\quad |B|=2 $$
Number of onto functions from a set of $6$ elements to a set of $2$ elements is
$$ 2^6-2 $$
Subtracting the two constant (non-onto) functions.
$$ =64-2=62 $$
Hence, the required number of onto functions is 62.
Updated for JEE Main 2026: This PYQ is important for JEE Mains, JEE Advanced and other competitive exams. Practice more questions from this chapter.