From 8e95c4eebe9028dc307957ccbfbbbabe73303b0d Mon Sep 17 00:00:00 2001 From: chayan das Date: Tue, 9 Jun 2026 20:29:06 +0530 Subject: [PATCH] Create 3689. Maximum Total Subarray Value I --- 3689. Maximum Total Subarray Value I | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 3689. Maximum Total Subarray Value I diff --git a/3689. Maximum Total Subarray Value I b/3689. Maximum Total Subarray Value I new file mode 100644 index 0000000..814afe6 --- /dev/null +++ b/3689. Maximum Total Subarray Value I @@ -0,0 +1,14 @@ +class Solution { +public: + long long maxTotalValue(vector& nums, int k) { + + long long mini = INT_MAX; + long long maxi = INT_MIN; + + for(int i:nums){ + if(imaxi) maxi = i; + } + return (maxi-mini)*k;; + } +};