Steps to find the answer?

@Shaik Masthan Source is mentioned in tags

Regular expression – (ba*a+ab*b)*(ab*+ba*)

DFA –

The number of states in minimal DFA is 7