defisPathCrossing(self, path:str)->bool:s =[0,0]res =[[0,0]]for i in path:if i =='W':s[0]-=1elif i =='S':s[1]-=1elif i =='E':s[0]+=1elif i =='N':s[1]+=1if s in res:returnTrueelse:res.append(s.copy())else:returnFalse