You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from collections import OrderedDict
def Solution(A):
if len(A) == 1:
return 0
tmp_result = OrderedDict()
for idx, a in enumerate(A):
if a in tmp_result:
continue
nb_divisors = len([x for x in A if not (a/x).is_integer()])
tmp_result[a] = nb_divisors
return [tmp_result[x] for x in A]
print(Solution(A))
[2, 4, 3, 2, 0]
The text was updated successfully, but these errors were encountered:
[2, 4, 3, 2, 0]
The text was updated successfully, but these errors were encountered: