Company: Godaddy_27aug
Difficulty: medium
Most Visited 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 marked with numbered positions. The coach provides a sequence of markers Pat must reach in order. Every time Pat starts, stops, 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. Example: Given: Number of markers on the trail: n = 5 Assigned sprint sequence: sprints = [2, 4, 1, 3] Pat completes the following sprints: From position 2 to position 4 From position 4 to position 1 From position 1 to position 3 The total visits to each marker in this example are calculated as follows: Sprint 1 2 3 4 5 2 → 4 • • • 4 → 1 &bul