class Solution { public: vector kidsWithCandies(vector& candies, int extraCandies) { int csize = candies.size(); int i = 0; int current; int max = *std::max_element(candies.begin(), candies.end()); // needs the *std to dereference the iterator returned by max_element (From algo library. Gets max val from the vector) vector kids; for (; i < csize; i++) { current = candies[i] + extraCandies; if (max <= current) { kids.push_back(true); } else { kids.push_back(false); } } return kids; } };