/**
 * Given a list of pets, the function 'veterinarianRecords' will determine the number of dogs
 * and cats in the list using a while loop. It will also keep track of the total number of
 * visits to the veterinarian's office and return the count of each pet.
 *
 * @param pets A list of strings representing the types of pets ('dog' or 'cat').
 * @return A Pair containing two integers representing the count of dogs and cats, respectively.
 *
 * Example:
 * veterinarianRecords(listOf("dog", "cat", "dog", "dog", "cat")) // Output: Pair(3, 2)
 */
fun veterinarianRecords(pets: List<String>): Pair<Int, Int> {

    var dogCount = 0
    var catCount = 0
    var visitCount = 0

    var i = 0
    while (i < pets.size) {
        visitCount++

        when (pets[i]) {
            "dog" -> dogCount++
            "cat" -> catCount++
        }

        i++
    }

    return Pair(dogCount, catCount)
}
/**
 * Given a list of pets, the function 'veterinarianRecords' will determine the number of dogs
 * and cats in the list using a while loop. It will also keep track of the total number of
 * visits to the veterinarian's office and return the count of each pet.
 *
 * @param pets A list of strings representing the types of pets ('dog' or 'cat').
 * @return A Pair containing two integers representing the count of dogs and cats, respectively.
 *
 * Example:
 * veterinarianRecords(listOf("dog", "cat", "dog", "dog", "cat")) // Output: Pair(3, 2)
 */
fun veterinarianRecords(pets: List<String>): Pair<Int, Int> {
/**
 * Given a list of pets, the function 'veterinarianRecords' will determine the number of dogs
 * and cats in the list using a while loop. It will also keep track of the total number of
 * visits to the veterinarian's office and return the count of each pet.
 *
 * @param pets A list of strings representing the types of pets ('dog' or 'cat').
 * @return A Pair containing two integers representing the count of dogs and cats, respectively.
 *
 * Example:
 * veterinarianRecords(listOf("dog", "cat", "dog", "dog", "cat")) // Output: Pair(3, 2)
 */
fun veterinarianRecords(pets: List<String>): Pair<Int, Int> {

    var dogCount = 0
    var catCount = 0
    var visitCount = 0

    var i = 0
    while (i < pets.size) {
        visitCount++

        when (pets[i]) {
            "dog" -> dogCount++
            "cat" -> catCount++
        }

        i++
    }

    return Pair(dogCount, catCount)
}