244 https://leetcode.com/problems/shortest-word-distance-ii/ 모든 word의 인덱스를 저장해놓는다. 그리고 구해야 하는 두 점에 대해서 투 포인터로 가장 근접해 있는 점 끼리의 최소값을 업데이트해준다. class WordDistance: def __init__(self, wd: List[str]): self.d = {} for i, w in enumerate(wd): self.d[w] = self.d.get(w, []) + [i] #print(self.d) def shortest(self, w1: str, w2: str) -> int: ret = 9999999999 i,j = 0,0 d1,d2 = self.d[w1],self.d[w2] while i < l..