design special dictionary search word prefix suffiximplement WordFilter classwordfilterstring word Initializes object word dictionaryfstre pref string suff Returns index word dictionary prefix pref suffix suff if valid index return large if word dictionary return 1 example 1inputwordfilter fapple eOutputnull 0explanationwordfilter wordFilter new wordfilterapplewordfilterfa e return 0 word index 0 prefix suffix e Constraints1 wordslength 1041 wordsilength 71 preflength sufflength 7wordsi pref suff consist lowercase english letter onlyAt 104 call function f