object SumOfMultiples {
    fun sum(inpList: Set<Int>, maxNum: Int): Int {
        val setOfMultiples = mutableSetOf<Int>()
        for (i in 1..maxNum-1){
            for (j in inpList) {
                if (i % j == 0){
                    setOfMultiples.add(i)
                }
            }
        }
        return setOfMultiples.sum()
    }
}