Substring
$:-$ The substring is a contiguous sequence of characters within a string$.$
$"RAJ"$
$0$ length substring $= \{\}$ $\Rightarrow 1$ substring possible.
$1$ length substring$=\{R,A,J\}\Rightarrow 3$ substrings possible.
$2$ length substring$=\{RA,AJ\}\Rightarrow 2$ substrings possible.
$3$ length substring$=\{RAJ\}\Rightarrow 1$ substring possible.
In general
Number of substrings $=1 + 2 + 3 + ...............+ n + 1 $(for empty string)$ =\frac{n(n+1)}{2} + 1$
Subsequence
$:-$The subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
$\Rightarrow$All possible substrings and all non-contiguous characters.
$"RAJ"$
subsequences$=\{\epsilon,R,RA,RJ,A,AJ,J,RAJ\}$
Number of subsequences$=2^{n}$