Company: Go Daddy_27aug
Difficulty: medium
Most Visited Trail Marker Problem Description Pat is training hard to become a great runner. As part of the daily regimen, Pat practices sprints along a straight trail with numbered positions. The coach provides a sequence of markers Pat must reach in order. Every time Pat starts at, stops at, or passes by a marker, it counts as a visit. Determine the lowest-numbered marker that Pat visits most frequently during the training session. Notes: A marker is visited if Pat starts, stops, or passes through it during any sprint. The training consists of sequential sprints from each marker in the provided list to the next. Complete the function getMostVisited in the editor with the following parameter(s): int n : the number of markers along the trail. int sprints[m] : the sequence of markers to reach, beginning at the marker shown in sprints[0] . Returns: int : an integer denoting Pat's most visited position on the trail after performing all m - 1 sprints. If there are multiple such answers, re