/**
 * Given a target value and an array of integers, return the count of how many integers there are before the target value appears in the array using a while loop.
 *
 * @param target An integer value representing the target value.
 * @param array A list of integers.
 * @return An integer representing the count of integers before the target value.
 */
fun countUntil(target: Int, array: List<Int>): Int {

    var count = 0
    var index = 0

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

    return count
}
/**
 * Given a target value and an array of integers, return the count of how many integers there are before the target value appears in the array using a while loop.
 *
 * @param target An integer value representing the target value.
 * @param array A list of integers.
 * @return An integer representing the count of integers before the target value.
 */
fun countUntil(target: Int, array: List<Int>): Int {
/**
 * Given a target value and an array of integers, return the count of how many integers there are before the target value appears in the array using a while loop.
 *
 * @param target An integer value representing the target value.
 * @param array A list of integers.
 * @return An integer representing the count of integers before the target value.
 */
fun countUntil(target: Int, array: List<Int>): Int {

    var count = 0
    var index = 0

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

    return count
}