• + 12 comments

    I have found an easier solution to this problem.Here is the algo. While reading the numbers keep track of the the least two distinct nos. Find the least common divisor of these nos.(>1) If it is 1,then condition is possible. Otherwise check if the lowest common divisor divides all the numbers. If so the subset is not possible. But if it leaves a remainder for at least one no. then the subset is possible.