I was solving a problem in which i need to figure out the prime factorization of $\frac{a!}{b!}$ and i did that by computing (a!) and then (b!) by looping ((1 to a) & (1 to b)) and then derived n by dividing them ($n = \frac{a!}{b!}$) and then prime factors of n, but it gives me to TLE(Time limit exceeded) so i refered editorial and in editorial they describe an alternate method , they says factorization of number $\frac{a!}{b!}$ is this same as factorization of numbers $(b + 1)\times(b + 2)\times \cdots\times (a - 1)\times a$.
I am unable to figure out how
$\frac{a!}{b!}$ == $(b + 1)\times(b + 2)\times \cdots\times (a - 1)\times a$ ?
Assume $a > b$. Then:
$$\frac{a!}{b!} = \frac{a(a-1)(a-2) \cdots (b+1) \cdot (b)(b-1)(b-2) \cdots (3)(2)(1)}{b(b-1)(b-2) \cdots (3)(2)(1)}$$ $$= \frac{a(a-1)(a-2) \cdots (b+1) \cdot \require{cancel} \cancel{(b)(b-1)(b-2) \cdots (3)(2)(1)}}{\cancel{(b(b-1)(b-2) \cdots (3)(2)(1)}}$$
Do you see how this works?