Why the STRIVER approach didn't work ??
class Solution {\npublic:\n    \n    long long solve(vector>&items , int n , int i , int k , map&m , int cnt)\n    {\n        if(i==n || cnt>k) return 0;\n     
class Solution {\npublic:\n    \n    long long solve(vector<vector<int>>&items , int n , int i , int k , map<int,int>&m , int cnt)\n    {\n        if(i==n || cnt>k) return 0;\n        \n        m[items[i][1]]++;\n        \n        long long pick=solve(items , n , i+1 , k , m , cnt+1) + (items[i][0] + pow(m.size() , 2));\n        \n            m[items[i][1]]--;\n            if (m[items[i][1]] == 0) m.erase(items[i][1]);\n        \n        \n        long long nonPick=solve(items , n , i+1 , k , m , cnt);\n\n            \n        return max(pick , nonPick);\n        \n    }\n    \n    \n    long long findMaximumElegance(vector<vector<int>>& items, int k) {\n        int n=items.size();\n        \n        int i=0;\n        map<int,int>m;\n        int cnt=0;\n        \n        return solve(items , n , i , k , m , cnt);\n        \n    }\n};
['Dynamic Programming', 'Greedy', 'C++']