Check for each divisor , if it is not divisible by any perfect square , simply return it as the answer .
for d in sorted ( s , reverse = True ) : NEW_LINE INDENT divi , j = 0 , 0 NEW_LINE while j < len ( vec ) and vec [ j ] <= d : NEW_LINE INDENT if d % vec [ j ] == 0 : NEW_LINE INDENT divi = 1 NEW_LINE break NEW_LINE DEDENT j += 1 NEW_LINE DEDENT if not divi : NEW_LINE INDENT return d NEW_LINE DEDENT DEDENT