/**
 * This function checks if each element in the given array is divisible by a divisor.
 *
 * @param arr A list of integers.
 * @param divisor An integer divisor.
 * @return A list containing the elements in the input array that are divisible by the divisor.
 */
fun divisibilityCheck(arr: List<Int>, divisor: Int): List<Int> {

    val divisibleNums = mutableListOf<Int>()  // Initialize an empty list to store the divisible elements

    for (num in arr) {
        if (num % divisor == 0) {  // Check if the element is divisible by the divisor
            divisibleNums.add(num)  // Add the divisible element to the list
        }
    }

    return divisibleNums
}
/**
 * This function checks if each element in the given array is divisible by a divisor.
 *
 * @param arr A list of integers.
 * @param divisor An integer divisor.
 * @return A list containing the elements in the input array that are divisible by the divisor.
 */
fun divisibilityCheck(arr: List<Int>, divisor: Int): List<Int> {
/**
 * This function checks if each element in the given array is divisible by a divisor.
 *
 * @param arr A list of integers.
 * @param divisor An integer divisor.
 * @return A list containing the elements in the input array that are divisible by the divisor.
 */
fun divisibilityCheck(arr: List<Int>, divisor: Int): List<Int> {

    val divisibleNums = mutableListOf<Int>()  // Initialize an empty list to store the divisible elements

    for (num in arr) {
        if (num % divisor == 0) {  // Check if the element is divisible by the divisor
            divisibleNums.add(num)  // Add the divisible element to the list
        }
    }

    return divisibleNums
}