A regular language can be represented as a deterministic finite automaton (DFA). A DFA contains a finite set of states $Q$ and a finite set of input symbols called the alphabet $Σ$. Initially, the DFA is positioned at the start state $q_0∈Q$. Given the transition function $δ(q,a)$ and an input symbol a, the DFA transit to state $δ(q,a)$ if its current state is $q$.
Let $w=a_1 a_2…a_n$ be a string over the alphabet $Σ$. According to the above definition, the DFA transits through the following sequence of states.
$$q_0,q_1=δ(q_0,a_1 ),q_2=δ(q_1,a_2 ),…,q_n=δ(q_{n-1},a_n )$$
The DFA also contains a set of accept states $F\subseteq Q$. If the last state $q_n$ is an accept state, we say that the DFA accepts the string $w$. The set of accepted strings is referred as the language that the DFA represents.
You are given two DFAs, and the languages that they represent may be different. You want to find the difference between the two languages. Specifically, you are trying to find a string that is accepted by one DFA but not accepted by the other DFA. As there could be multiple such strings, you only want the shortest one. If there are still multiple such strings, you would like the smallest one in lexicographical order.