We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Put the condition if k is more than important then return total count. Here is the snippet and with this condition all test cases are passing (PS: without this condition, test case 7 and 8 were failing). I am not posting the whole code :)
int luckBalance(int k, vector> contests) {
sort(contests.begin(), contests.end(), [](vector&a, vector&b){return a[0]=important)
return total;
....... //your rest of the logic
....... // goes
........ // here
}
Luck Balance
You are viewing a single comment's thread. Return to all comments →
Put the condition if k is more than important then return total count. Here is the snippet and with this condition all test cases are passing (PS: without this condition, test case 7 and 8 were failing). I am not posting the whole code :)
int luckBalance(int k, vector> contests) { sort(contests.begin(), contests.end(), [](vector&a, vector&b){return a[0]=important) return total; ....... //your rest of the logic ....... // goes ........ // here }