Advertisement
DarkoreXOR

Untitled

Mar 26th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. std::vector<int> countPositivesSumNegatives(std::vector<int> input)
  2. {
  3.     return std::vector<int>
  4.     {
  5.         std::count_if(input.begin(), input.end(), [] (int x) { return x > 0; }),
  6.         std::accumulate(input.begin(), input.end(), 0, [] (int s, int x) { return s + std::min(0, x); }),
  7.     };
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement