Company: Godaddy_27aug
Difficulty: medium
Most Visited Marker Problem Description Pat trains by sprinting along a straight trail. The trail has n markers, numbered 1 to n in order along the trail. The coach hands Pat a list sprints of m markers. Pat starts at marker sprints[0] and then sprints directly to sprints[1] , then to sprints[2] , and so on until reaching sprints[m-1] . That is m - 1 sprints in total. During each sprint from marker a to marker b , Pat visits every marker from a to b inclusive: the marker Pat starts at, every marker Pat passes, and the marker Pat stops at. Visits are counted separately for every sprint, so a marker where one sprint ends and the next one begins is visited twice: once as the stop of the first sprint and once as the start of the next. Find the marker with the largest total number of visits over all sprints. If several markers share the largest total, return the smallest marker number among them. Complete the function getMostVisited(n, sprints) , which returns that marker. Input Format Read