• + 0 comments
        def numDiv(l: List[Int]) ={
            val x = l.min
            var set = (1 to x).filter(x % _ == 0).toSet
            l.foreach(i => set = set.filter(i % _ ==0).toSet)
            set.size
        }
    

    Works for 9 test cases, but failed on one due to the time limit.