You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// After the operation, the resultant array should not contain any negative integers.
35
+
if (arr[i] - k < 0)continue;
36
+
max = Math.max(arr[i - 1] + k, arr[n - 1] - k); // subtracting k from largest element and comparing the max from the rest of the elements after subtracting k from them
37
+
min = Math.min(arr[0] + k, arr[i] - k); // adding k to the smallest element and comparing the min from the rest of the elements after adding k to them
0 commit comments