Skip to content

Commit 763821a

Browse files
committed
Jun 12
1 parent f746603 commit 763821a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution:
2+
def maxAdjacentDistance(self, nums: list[int]) -> int:
3+
return max(abs(n1 - n2) for n1, n2 in zip(nums, nums[1:] + nums[:1]))
4+
5+
6+
def main():
7+
nums = [1, 2, 4]
8+
assert Solution().maxAdjacentDistance(nums) == 3
9+
10+
nums = [-5, -10, -5]
11+
assert Solution().maxAdjacentDistance(nums) == 5
12+
13+
14+
if __name__ == '__main__':
15+
main()

2025-06-June-LeetCoding-Challenge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| June 09 | [440. K-th Smallest in Lexicographical Order](https://leetcode.com/problems/k-th-smallest-in-lexicographical-order/) | Hard | Unsolved |
1616
| June 10 | [3442. Maximum Difference Between Even and Odd Frequency I](https://leetcode.com/problems/maximum-difference-between-even-and-odd-frequency-i/) | Easy | Solved |
1717
| June 11 | [3445. Maximum Difference Between Even and Odd Frequency II](https://leetcode.com/problems/maximum-difference-between-even-and-odd-frequency-ii/) | Hard | Unsolved |
18-
| June 12 | []() | | |
18+
| June 12 | [3423. Maximum Difference Between Adjacent Elements in a Circular Array](https://leetcode.com/problems/maximum-difference-between-adjacent-elements-in-a-circular-array/) | Easy | Solved |
1919
| June 13 | []() | | |
2020
| June 14 | []() | | |
2121
| June 15 | []() | | |
@@ -39,6 +39,6 @@
3939
## Summary
4040
| Level | Problems | Solved | Unsolved |
4141
| --- | --- | --- | --- |
42-
| Easy | 1 | 1 | 0 |
42+
| Easy | 2 | 2 | 0 |
4343
| Medium | 6 | 3 | 3 |
4444
| Hard | 4 | 2 | 2 |

0 commit comments

Comments
 (0)