→ 1436. Destination City:
→ Leetcode: https://leetcode.com/problems/destination-city/
Please review all the solutions and try implementing on your own if you haven’t gotten it.
class Solution: def destCity(self, paths: List[List[str]]) -> str: curr =  nex =  for i in range(len(paths)): curr.append(paths[i]) nex.append(paths[i]) c = paths while(nex[curr.index(c)] in curr): c = nex[curr.index(c)] return nex[curr.index(c)]