From 9a6da5b1e9128b5f1868e938af34723ad98fca78 Mon Sep 17 00:00:00 2001 From: chayan das <110921638+Chayandas07@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:22:45 +0530 Subject: [PATCH] Create 2558. Take Gifts From the Richest Pile1 --- 2558. Take Gifts From the Richest Pile1 | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 2558. Take Gifts From the Richest Pile1 diff --git a/2558. Take Gifts From the Richest Pile1 b/2558. Take Gifts From the Richest Pile1 new file mode 100644 index 0000000..cf53d03 --- /dev/null +++ b/2558. Take Gifts From the Richest Pile1 @@ -0,0 +1,41 @@ +class Solution1 { +public: + long long pickGifts(vector& gifts, int k) { + long long ans=0; + for(int i=0;igifts[m]) m=j; + int a=gifts[m]; + // cout<& gifts, int k) { + long long ans=0; + priority_queue vp; + for(int i : gifts) vp.push(i); + for(int i=0;i