A stupid Python solution
\nclass Solution:\n    def numTeams(self, rating: List[int]) -> int:\n        from itertools import combinations\n        \n        comb = combinations(rating, 
```\nclass Solution:\n    def numTeams(self, rating: List[int]) -> int:\n        from itertools import combinations\n        \n        comb = combinations(rating, 3)\n        count = 0\n        \n        for i in comb:\n            if ((i[0]>i[1] and i[1]>i[2]) or\n                (i[0]<i[1] and i[1]<i[2])):\n                \n                count+=1\n        return count\n```\n\n\n
['Python']