Make dictionary
D = { } NEW_LINE D [ " poon " ] = 1 NEW_LINE D [ " plee " ] = 1 NEW_LINE D [ " same " ] = 1 NEW_LINE D [ " poie " ] = 1 NEW_LINE D [ " plie " ] = 1 NEW_LINE D [ " poin " ] = 1 NEW_LINE D [ " plea " ] = 1 NEW_LINE start = " toon " NEW_LINE target = " plea " NEW_LINE print ( " Length ▁ of ▁ shortest ▁ chain ▁ is : ▁ " , shortestChainLen ( start , target , D ) ) NEW_LINE