Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<int> countPositivesSumNegatives(std::vector<int> input)
- {
- return std::vector<int>
- {
- std::count_if(input.begin(), input.end(), [] (int x) { return x > 0; }),
- std::accumulate(input.begin(), input.end(), 0, [] (int s, int x) { return s + std::min(0, x); }),
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement