and what is the result if the start word is equal to the target word...? i think the output it should be 0.
here are some testcases i made:
Code: Select all
AAA FUN 4
A g
Ag PO
PO zz
Azz FUN
AAF BBB 4
AF ox
Aox HAB
AB ox
Hox BBB
AAF AAg 1
F g
AAF AAg 2
F g
AF Ag
.
Case 1: 4
Case 2: 4
Case 3: 1
Case 4: 1
Code: Select all
ffwiwna POWKQND 15
a b
b c
c d
d D
nD ok
ok qp
qp pq
wpq nok
npq wok
iwpq fuca
fucD wwnD
wwwpq ianna
fiawok awwwpq
ffiawok PafuwnD
Pafuwok POWKQND