defremoveDuplicatesFromList(seq):#Notorderpreservingkeys={}foreinseq:keys[e]=1returnkeys.keys()defcountWordDistances(li):'''Ifli=['that','sank','into','the','ocean']Thisfunctionwouldreturn:{that:1,sank:2,into:3,the:4,ocean:5}However,ifthereisaduplicateterm,taketheaverageoftheirpositions'''wordma