Skip to content

Commit 106263f

Browse files
Added solutions
1 parent 2a1e092 commit 106263f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

169.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Runtime: 40 ms, faster than 54.99% of Python online submissions for Majority Element.
2+
# Difficulty: Easy
3+
4+
class Solution(object):
5+
def majorityElement(self, nums):
6+
"""
7+
:type nums: List[int]
8+
:rtype: int
9+
"""
10+
values = dict()
11+
for num in nums:
12+
values[num] = values.get(num, 0) + 1
13+
return max(values, key=values.get)

182.sql

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Runtime: 185 ms, faster than 67.53% of MySQL online submissions for Duplicate Emails.
2+
# Difficulty: Easy
3+
4+
select Email from Person group by Email having count(*) > 1;

0 commit comments

Comments
 (0)