| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- recursion
- 2750
- 수 정렬하기
- 피보나치 수
- 파이썬머신러닝완벽가이드
- codesingal
- All Longest Strings
- centuryFromYear
- data_structure
- 2015 봄학기 알고리즘
- 10953
- codesignal
- til
- Counting cells in a blob
- shapeArea
- Numpy
- 파이썬 포렌식
- cpp
- C++
- Daily Commit
- collections.deque
- adjacentElementsProduct
- flask
- Python
- baekjun
- Sequential Search
- 백준
- almostIncreasingSequence
- matrixElementsSum
- markdown
Archives
- Today
- Total
Introfor
HackerRank - Sales by Match 본문
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the sockMerchant function below.
def sockMerchant(n, ar):
res = 0
for i in set(ar):
res += ar.count(i) // 2
return res
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
ar = list(map(int, input().rstrip().split()))
result = sockMerchant(n, ar)
fptr.write(str(result) + '\n')
fptr.close()
|
cs |
'Doing > Python' 카테고리의 다른 글
| [hackerRank]sWAP cASE (0) | 2021.03.05 |
|---|---|
| Recursion. Finding Maze Path and Counting Cells in a Blob (0) | 2020.09.16 |
| 파이썬 자료형에 따른 주요 연산자의 시간 복잡도 (0) | 2020.09.11 |
| [Algorithm] Recursion (0) | 2020.07.23 |
| [data_structure] Queue (0) | 2020.07.21 |
Comments