Skip to content

Commit a86f390

Browse files
authored
Create 3978. Unique Middle Element.py
1 parent 9c20ee5 commit a86f390

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from collections import defaultdict
2+
class Solution:
3+
def isMiddleElementUnique(self, nums: list[int]) -> bool:
4+
return Counter(nums)[nums[len(nums)//2]] == 1

0 commit comments

Comments
 (0)