Initialize a variable to count the number of elements it is a factor of
count = 0 NEW_LINE for j in arr : NEW_LINE INDENT if j % i == 0 : count += 1 NEW_LINE DEDENT rank . append ( count ) NEW_LINE factors . append ( i ) NEW_LINE