This commit is contained in:
parent
e9aef2c95d
commit
47ddfc37e5
1 changed files with 11 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
# https://leetcode.com/problems/maximum-difference-between-adjacent-elements-in-a-circular-array
|
||||
|
||||
from typing import List
|
||||
|
||||
class Solution:
|
||||
def maxAdjacentDistance(self, nums: List[int]) -> int:
|
||||
result = 0
|
||||
for i in range(len(nums)):
|
||||
result = max(abs(nums[i] - nums[i - 1]), result)
|
||||
return result
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue