100 % faster cpp easy sol
class Solution {\npublic:\n    int numTeams(vector& a) {\n      int i,n=a.size(),sum=0;\n        for(i=1;i=0;j--){\n                if(a[i]>a[j]){\n            
class Solution {\npublic:\n    int numTeams(vector<int>& a) {\n      int i,n=a.size(),sum=0;\n        for(i=1;i<n-1;i++){\n            int countgr=0,countlr=0,countgl=0,countll=0;\n            for(int j=i-1;j>=0;j--){\n                if(a[i]>a[j]){\n                    countgl++;\n                }else{\n                    if(a[i]<a[j]){\n                        countll++;\n                    }\n                }\n            }\n          \n            for(int j=i+1;j<n;j++){\n                if(a[i]<a[j]){\n                    countlr++;\n                }else{\n                    if(a[i]>a[j]){\n                        countgr++;\n                    }\n                }\n            }\n            \n            sum+=(countll*countgr)+(countgl*countlr);\n              \n        }\n        return sum;\n    }\n};
['C', 'C++']