Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Oj-Bademosi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#Problem 2
from collections import Counter

#accept the number of integers

n = int(input())

#accept the integers , this will create list of the input values

a = list(map(int,input().split()))

#acepst the value of k

k = int(input())

#this will create a frequenct distribution dictionary

#key will be the values and value will be the number of times they occur

c = Counter(a)

ans_list = []

#now iterate over this collectiosn and findall which ahve k as the frequency

for i in c.items():

# if frequency is same as k append it to list

if i[1]==k:

ans_list.append(i[0])

#finally print the min value in list

print(min(ans_list))