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
Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.
Space: O(1)
Time: O(n)
*/
int max(int a, int b) {
return a>b?a:b;
}
int* replaceElements(int* arr, int arrSize, int* returnSize){