/**
 * This exercise requires you to write a method that counts the number of occurrences of a specific element in an array.
 *
 * @param array A list of integers representing the input array.
 * @param element An integer representing the element to count.
 * @return An integer representing the number of occurrences of the element in the array.
 *
 * Instructions:
 * 1. Initialize a variable named 'count' with an initial value of 0.
 * 2. Use a for loop to iterate over each element in the array.
 * 3. Inside the loop, check if the current element equals the given element.
 * 4. If they are equal, increment the 'count' variable by 1.
 * 5. After the loop, return the 'count' variable.
 */
fun countElements(array: List<Int>, element: Int): Int {

    var count = 0

    for (num in array) {
        if (num == element) {
            count++
        }
    }

    return count
}
/**
 * This exercise requires you to write a method that counts the number of occurrences of a specific element in an array.
 *
 * @param array A list of integers representing the input array.
 * @param element An integer representing the element to count.
 * @return An integer representing the number of occurrences of the element in the array.
 *
 * Instructions:
 * 1. Initialize a variable named 'count' with an initial value of 0.
 * 2. Use a for loop to iterate over each element in the array.
 * 3. Inside the loop, check if the current element equals the given element.
 * 4. If they are equal, increment the 'count' variable by 1.
 * 5. After the loop, return the 'count' variable.
 */
fun countElements(array: List<Int>, element: Int): Int {
/**
 * This exercise requires you to write a method that counts the number of occurrences of a specific element in an array.
 *
 * @param array A list of integers representing the input array.
 * @param element An integer representing the element to count.
 * @return An integer representing the number of occurrences of the element in the array.
 *
 * Instructions:
 * 1. Initialize a variable named 'count' with an initial value of 0.
 * 2. Use a for loop to iterate over each element in the array.
 * 3. Inside the loop, check if the current element equals the given element.
 * 4. If they are equal, increment the 'count' variable by 1.
 * 5. After the loop, return the 'count' variable.
 */
fun countElements(array: List<Int>, element: Int): Int {

    var count = 0

    for (num in array) {
        if (num == element) {
            count++
        }
    }

    return count
}