Why did this input return [31]?


  • 0
    S

    This problem states:

    ...find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or Sj % Si = 0.

    So how could the solution set include only one number?

    input of [2,3,5,7,11,13,17,19,23,31,1000000007] results in the expected solution of [31]!
    input of [546,669] results in the expected solution of [546]!

    Can someone explain why the expected solution has only one number? Why shouldn't those result in empty solutions sets?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.