LeetCode --- 1560. Most Visited Sector in a Circular Track 解题报告
Posted 杨鑫newlfe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1560. Most Visited Sector in a Circular Track 解题报告相关的知识,希望对你有一定的参考价值。
Given an integer n
and an integer array rounds
. We have a circular track which consists of n
sectors labeled from 1
to n
. A marathon will be held on this track, the marathon consists of m
rounds. The ith
round starts at sector rounds[i - 1]
and ends at sector rounds[i]
. For example, round 1 starts at sector rounds[0]
and ends at sector rounds[1]
Return an array of the most visited sectors sorted in ascending order.
Notice that you circulate the track in ascending order of sector numbers in the counter-clockwise direction (See the first example).
Example 1:
Input: n = 4, rounds = [1,3,1,2] Output:
以上是关于LeetCode --- 1560. Most Visited Sector in a Circular Track 解题报告的主要内容,如果未能解决你的问题,请参考以下文章
LeetCode Most Frequent Subtree Sum
Leetcode 508. Most Frequent Subtree Sum
[Leetcode] Container With Most Water