leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE |

1431.cpp (345B)


1 class Solution { 2 public: 3 vector<bool> kidsWithCandies(vector<int> &candies, int extraCandies) { 4 int maxi = *max_element(candies.begin(), candies.end()); 5 vector<bool> res(candies.size()); 6 for (int i = 0; i < candies.size(); i++) 7 res[i] = (maxi - candies[i]) <= extraCandies; 8 return res; 9 } 10 };