athenahealth Interview Question

Given a string do a shift operation on left and right for their respective values. Products array. Find the maximum occurrence and then return the last element of the maximum occurred product in the ascending order. Last man standing puzzle as a problem. N can be infinite.