Brute Force Approach|| Easy Understandable but ugly TC :(
Approach\n - We know always rotation = len(nums) - 1\n - Pick 1 no from the list in the outer loop\n - Check from the very next element in the inner loop\n -  -
# Approach\n - We know always ```rotation = len(nums) - 1```\n - Pick 1 no from the list in the outer loop\n - Check from the very next element in the inner loop\n -  -```if nums[i] < nums[j]:``` then add ```nums[j]```\n -  -```else``` add ```-1``` at the outer loop\n# Complexity\n- Space complexity:\nBeats 95%\n# Code\n```\nclass Solution:\n    def nextGreaterElements(self, nums: List[int]) -> List[int]:\n        ans = []\n        flag = False\n        for i in range(len(nums)):\n            j = i + 1\n            rotation = len(nums) - 1\n            while rotation > 0:\n                if j >= len(nums):\n                    j = 0\n                if nums[i] < nums[j]:\n                    ans.append(nums[j])\n                    flag = True\n                    break\n                else:\n                    rotation -= 1\n                    j += 1\n                    flag = False\n            if flag == False:\n                ans.append(-1)\n        return ans\n```
['Python3']