/**
 * Given a sequence 'seq" and a target value 'target`, count the number of times
 * the target value appears in the sequence.
 *
 * @param seq A list of values.
 * @param target The value to count.
 * @return The number of times the target value appears in the sequence.
 *
 * Example:
 * countSequence(listOf(1, 2, 3, 2, 1), 2) // Output: 2
 */
fun countSequence(seq: List<Any>, target: Any): Int {

    var count = 0

    for (element in seq) {
        if (element == target) {
            count++
        }
    }

    return count
}
/**
 * Given a sequence 'seq" and a target value 'target`, count the number of times
 * the target value appears in the sequence.
 *
 * @param seq A list of values.
 * @param target The value to count.
 * @return The number of times the target value appears in the sequence.
 *
 * Example:
 * countSequence(listOf(1, 2, 3, 2, 1), 2) // Output: 2
 */
fun countSequence(seq: List<Any>, target: Any): Int {
/**
 * Given a sequence 'seq" and a target value 'target`, count the number of times
 * the target value appears in the sequence.
 *
 * @param seq A list of values.
 * @param target The value to count.
 * @return The number of times the target value appears in the sequence.
 *
 * Example:
 * countSequence(listOf(1, 2, 3, 2, 1), 2) // Output: 2
 */
fun countSequence(seq: List<Any>, target: Any): Int {

    var count = 0

    for (element in seq) {
        if (element == target) {
            count++
        }
    }

    return count
}