Skip to content

Commit 1f012ef

Browse files
724thomasheyhyo11
authored andcommitted
Create 3978. Unique Middle Element.py
1 parent ca61763 commit 1f012ef

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)