aboutsummaryrefslogtreecommitdiff
path: root/min_operations_x_zero.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'min_operations_x_zero.cpp')
-rw-r--r--min_operations_x_zero.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/min_operations_x_zero.cpp b/min_operations_x_zero.cpp
index a838ab9..011839e 100644
--- a/min_operations_x_zero.cpp
+++ b/min_operations_x_zero.cpp
@@ -12,7 +12,7 @@ public:
for (int i = nums.size() - 1, sum = 0; i >= 0 && sum <= x; --i) {
auto it = left.find(x - sum);
if (it != end(left) && i + 1 >= it->second)
- ans = min(ans, (int)nums.size() - i - 1 + it->second);
+ ans = min(ans, nums.size() - i - 1 + it->second);
sum += nums[i];
}
return ans = INT_MAX ? -1 : ans;