We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
/* * Complete the 'gamingArray' function below. * * The function is expected to return a STRING. * The function accepts INTEGER_ARRAY arr as parameter. */stringgamingArray(vector<int>arr){vector<int>mx;// vector of max valuesmx.push_back(arr[0]);intcurr_max=arr[0];for(size_ti=1;i<arr.size();++i){if(arr[i]>curr_max){curr_max=arr[i];mx.push_back(arr[i]);}}returnmx.size()%2==0?"ANDY":"BOB";}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Gaming Array
You are viewing a single comment's thread. Return to all comments →