-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
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]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels