Left-Factoring : The process of conversion of the grammar with common prefixes into deterministic grammar is known as left factoring.
Syntax: if the CFG is of the form $A \rightarrow aA_1 \mid aA_2 \mid \dots aA_n$
Left factored grammar is
$A \rightarrow aA'$
$A' \rightarrow A_1 \mid A_2 \mid \dots A_n$
Left factored grammar for the given grammar is
$S \rightarrow aA' \mid dB'$
$A' \rightarrow BcD \mid BD$
$B' \rightarrow aB \mid \epsilon$
$B \rightarrow b$
$D \rightarrow d$