/**
 * This exercise aims to count the number of occurrences of a target element in a given sequence.
 * The sequence can be a list or string.
 *
 * @param sequence a list or string
 * @param target the element to count within the sequence
 * @return the count of occurrences of the target element in the sequence
 */
fun countOccurrences(sequence: List<Any>, target: Any): Int {

    var count = 0
    var index = 0

    while (index < sequence.size) {
        if (sequence[index] == target) {
            count++
        }
        index++
    }

    return count
}
/**
 * This exercise aims to count the number of occurrences of a target element in a given sequence.
 * The sequence can be a list or string.
 *
 * @param sequence a list or string
 * @param target the element to count within the sequence
 * @return the count of occurrences of the target element in the sequence
 */
fun countOccurrences(sequence: List<Any>, target: Any): Int {
/**
 * This exercise aims to count the number of occurrences of a target element in a given sequence.
 * The sequence can be a list or string.
 *
 * @param sequence a list or string
 * @param target the element to count within the sequence
 * @return the count of occurrences of the target element in the sequence
 */
fun countOccurrences(sequence: List<Any>, target: Any): Int {

    var count = 0
    var index = 0

    while (index < sequence.size) {
        if (sequence[index] == target) {
            count++
        }
        index++
    }

    return count
}