well, lets start slow...

Your solution passed all tests

KiXtart
KiXtart Version = 4.60 Beta 1
KiXGolf Script = kixgolf_A2Z.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium Model 13
Speed = 1862 MHz
Memory = 1014 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A-to-Z
Processing Start = 2007/09/13 23:32:18.497
Processing End = 2007/09/13 23:32:18.559
Duration = 0000/00/00 00:00:00.061
KiXGolf Score = 213


 Code:
function a($b,$c)
    dim $,$d,$e
    $a=0
    for each $ in $b
        dim $f
        for each $d in $b
            if $<$d
                for $e = -($^) to -2
                    if right($,-$e)=left($d,-$e)
                        $=$+' '+$d
                        $f=$f-$e+1
                    else
                        if right($,1)=$c[1] & left($,1)=$c[0] & ($|)-$f<$a | ~$a
                            $a=''+(($|)-$f)+' '+$
endfunction
_________________________
!

download KiXnet