/**
 * This function takes a list of numbers and a factor as input, creates a set from given numbers,
 * and multiplies each element in the set by the factor. The updated set is then returned.
 *
 * @param numbers A list of numbers.
 * @param factor The factor to multiply each element of the set by.
 * @return Set containing the multiplied elements.
 *
 * Example:
 * createSetAndMultiply(listOf(1, 2, 3, 4), 2) -> [8, 2, 4, 6]
 * createSetAndMultiply(listOf(-1, 5, 7, 9), -3) -> [21, -9, -15, -21]
 */
fun createSetAndMultiply(numbers: List<Int>, factor: Int): Set<Int> {

    // Convert list to set
    val setNumbers = numbers.toSet()

    // Apply multiplication to each element in the set
    val multipliedSet = setNumbers.map { it * factor }.toSet()

    return multipliedSet
}
/**
 * This function takes a list of numbers and a factor as input, creates a set from given numbers,
 * and multiplies each element in the set by the factor. The updated set is then returned.
 *
 * @param numbers A list of numbers.
 * @param factor The factor to multiply each element of the set by.
 * @return Set containing the multiplied elements.
 *
 * Example:
 * createSetAndMultiply(listOf(1, 2, 3, 4), 2) -> [8, 2, 4, 6]
 * createSetAndMultiply(listOf(-1, 5, 7, 9), -3) -> [21, -9, -15, -21]
 */
fun createSetAndMultiply(numbers: List<Int>, factor: Int): Set<Int> {
/**
 * This function takes a list of numbers and a factor as input, creates a set from given numbers,
 * and multiplies each element in the set by the factor. The updated set is then returned.
 *
 * @param numbers A list of numbers.
 * @param factor The factor to multiply each element of the set by.
 * @return Set containing the multiplied elements.
 *
 * Example:
 * createSetAndMultiply(listOf(1, 2, 3, 4), 2) -> [8, 2, 4, 6]
 * createSetAndMultiply(listOf(-1, 5, 7, 9), -3) -> [21, -9, -15, -21]
 */
fun createSetAndMultiply(numbers: List<Int>, factor: Int): Set<Int> {

    // Convert list to set
    val setNumbers = numbers.toSet()

    // Apply multiplication to each element in the set
    val multipliedSet = setNumbers.map { it * factor }.toSet()

    return multipliedSet
}