Update
Let me add a few more concrete considerations regarding the model presented in the OP. First point is purely biological: A matches to T (AT), whereas C matches to G (CG), and sometimes there is also non-canonical pair GT. CG consist of three hydrogen bonds, AT of two, and GT of one, so they have different energy. In addition, as I mentioned previously, RNA has Uracil (U) instead of Thymine (T). It is hard to judge by the question, whether youa dopted new naming conventions or simply were not aware of this.
Basic model
The energy of a chain is typically expressed not as a sum of single nucleotdie energies, but as a sum of pairing energies. Let $i$ be the index of the RNA chain and $j$ be the index of the DNA chain. If we have pairs $(i_1, j_1), (i_2, j_2),...,(i_K, j_K)$ then the energy of a this configuration can be written as
$$
E\left[\{(i_k,j_k)|k=1...K\}\right]=\sum_{k=1}^K\epsilon\left[\sigma(i_k),\sigma(j_k))\right],
$$
where $\epsilon(\sigma_1,\sigma_2)$ is teh pairing energy between the nucletides with identities $\sigma_1$ and $\sigma_2$.
A more handy way of describing pairing configurations is by introducing pairing matrix $M_{ij}$ which has entries $1$ for paired nucleotides and zeros elsewhere. The we could write the energy as a sum over all the sites:
$$
E(M) = \sum_i\sum_j\epsilon\left[\sigma(i),\sigma(j)\right]M_{ij}
$$
If both chains have length $N$, this gives $2^{N^2}$ different configurations. This number is usually reduced by introducing the non-crossing constraint - that is bonds not cross (how it is written in terms of indices $i$ and $j$ depends on the direction in which you enumerate the two chains). Still, the number of configurations is huge for realistic chains. This is why one ahs to resort to recirsive relations that express the partition function of longer chains in terms of those of shorter ones. Nussinov's algorithm is the simplest case, treating only the ground state energy and assuming that all the binding energies are equal. There are more advanced versions of this algorithm associated with the names of Mathews and Zucker, who have published extensively on the subject, but you may also look here and here.
Realistic models
The problem with the model described baove is that it is not realistic. The pairing energies are often much smaller than the stacking energies, i.e., the energies between the adjacent pairs. This may be especially important in your case, since the pairs in the mismatched configuration may have the same energy as the adjacent pairs. To make things worse, the stacking enery is dependent on the solution in which the molecules live, i.e., they may be different in a molecule in a cell nucleus, in cytoplasm, and in a lab.
The Nussnov-like algorithms have been developed for this case, I particularly recommend sorting through the Turner's lab page that I cited above.
String matching and maximum likelihood
String matching and maximum likelihood mean rather specific concepts in bioinformatics and biostatistics respectively. I am not sure whether these terms were used in the question in their true meaning or as figures of speech, since they may lead very far away from what seems the immediate subject. I suggest checking my post on string algorithms in bioinformatics forum for gaining some common ground.