Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a054cd7

Browse files
idea
1 parent ebe93ca commit a054cd7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

‎Sets/Introduction to Sets/Solution.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def average(array):
2+
distinct_heights = set(array)
3+
return sum(distinct_heights) / len(distinct_heights)
4+
5+
6+
if __name__ == '__main__':
7+
n = int(input())
8+
arr = list(map(int, input().split()))
9+
result = average(arr)
10+
print(result)

‎Sets/No Idea!/Solution.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
n, m = input().split()
2+
3+
array = input().split()
4+
A = set(input().split())
5+
B = set(input().split())
6+
7+
print(sum([(i in A) - (i in B) for i in array]))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /