From 17fc3ee797797f5b4de167121638c374e1009b2e Mon Sep 17 00:00:00 2001 From: Tushar Tanaji Kurade Date: Wed, 29 Oct 2025 23:52:41 +0530 Subject: [PATCH] Implement kidsWithCandies function --- kidsWithCandies_shadowkakashi.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 kidsWithCandies_shadowkakashi.cpp diff --git a/kidsWithCandies_shadowkakashi.cpp b/kidsWithCandies_shadowkakashi.cpp new file mode 100644 index 0000000..f010513 --- /dev/null +++ b/kidsWithCandies_shadowkakashi.cpp @@ -0,0 +1,9 @@ +class Solution { +public: + vector kidsWithCandies(vector& candies, int extraCandies) { + int mx = *max_element(candies.begin(), candies.end()); + vector res; + for (int c : candies) res.push_back(c + extraCandies >= mx); + return res; + } +};