Calculates index of a word within a sorted list of its anagrams