Skip to content

Commit 8dd088c

Browse files
Merge pull request #1834 from CodingTestStudy2/김민제
[김민제] Day16
2 parents df835cd + cece58e commit 8dd088c

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
class Solution:
3+
def largestInteger(self, nums: List[int], k: int) -> int:
4+
count = {}
5+
6+
for i in range(len(nums) - k + 1):
7+
sub = set(nums[i:i+k])
8+
9+
for num in sub:
10+
count[num] = count.get(num, 0) + 1
11+
12+
answer = -1
13+
14+
for num in count:
15+
if count[num] == 1:
16+
answer = max(answer, num)
17+
18+
return answer
19+

0 commit comments

Comments
 (0)