Python Accepted✅
\nclass Solution:\n    def lastVisitedIntegers(self, words: List[str]) -> List[int]:\n        n = []\n        a = []\n        p=0\n        for w in words:\n    
```\nclass Solution:\n    def lastVisitedIntegers(self, words: List[str]) -> List[int]:\n        n = []\n        a = []\n        p=0\n        for w in words:\n            if w=="prev":\n                if p<len(n):\n                    a.append(n[-1-p])\n                else:\n                    a.append(-1)\n                p+=1\n                \n            else:\n                i = int(w)\n                n.append(i)\n                p=0\n                \n        return a \n```
['Python']