You are viewing a single comment's thread. Return to all comments →
void plusMinus(vector<int> arr) { int cnt[3] = {0,0,0}; float s = 1.0f/arr.size(); for (auto x : arr) cnt[(x > 0) - (x < 0) + 1]++; cout << fixed; cout << s * cnt[2] << endl; cout << s * cnt[0] << endl; cout << s * cnt[1] << endl; }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Plus Minus
You are viewing a single comment's thread. Return to all comments →