Skip to content

Practice Maximum Difference Between Adjacent Elements in a Circular Array

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#3423
LeetCode Problem

Maximum Difference Between Adjacent Elements in a Circular Array

Problem Statement

Given a circular array nums, find the maximum absolute difference between adjacent elements. Note: In a circular array, the first and last elements are adjacent.

Source: Maximum Difference Between Adjacent Elements in a Circular Array on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [1,2,4]
Output
3

# Example 2

Input
nums = [-5,-10,-5]
Output
5

Constraints

2 <= nums.length <= 100
-100 <= nums[i] <= 100

Related LeetCode Problems

Practice more problems similar to Maximum Difference Between Adjacent Elements in a Circular Array.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.