"""
Given an array of integers a,
your task is to calculate the digits that occur the most number of times in the array.
Return the array of these digits in ascending order.
For a = [25, 2, 3, 57, 38, 41],
the output should be solution(a) = [2, 3, 5].
Here are the number of times each digit appears in the array:
0 -> 0
1 -> 1
2 -> 2
3 -> 2
4 -> 1
5 -> 2
6 -> 0
7 -> 1
8 -> 1
"""
x='123425112345'
d={}
for i in x:
try:
d[i]+=1
except:
d[i]=1
print(d)
max=0
for i in d:
if(d[i]>max):
max=d[i]
print(max)
l=[int(k) for k,v in d.items() if v==max]
print(l)
To embed this program on your website, copy the following code and paste it into your website's HTML: