/**
 * This exercise requires you to create a code that finds the lowest value character in a given string and counts how many times it appears.
 *
 * Implement a function called 'findLowestValue" that takes a string as input.
 * The function should iterate over each character in the string and compare it with the other characters.
 * Use nested if-else statements to keep track of the lowest value character.
 * Finally, return the lowest value character and the count of its occurrences as a Pair.
 *
 * Example:
 * findLowestValue("physical therapy") ➞ Pair(' ', 2)
 *
 * In this example, the lowest value character is a space (' ') and it appears twice in the string.
 */
fun findLowestValue(input: String): Pair<Char, Int> {

    var lowestValue: Char? = null
    var lowestCount: Int? = null

    for (char in input) {
        var count = 0
        for (otherChar in input) {
            if (char == otherChar) {
                count++
            }
        }

        if (lowestCount == null || count < lowestCount) {
            lowestValue = char
            lowestCount = count
        }
    }

    return Pair(lowestValue!!, lowestCount!!)
}
/**
 * This exercise requires you to create a code that finds the lowest value character in a given string and counts how many times it appears.
 *
 * Implement a function called 'findLowestValue" that takes a string as input.
 * The function should iterate over each character in the string and compare it with the other characters.
 * Use nested if-else statements to keep track of the lowest value character.
 * Finally, return the lowest value character and the count of its occurrences as a Pair.
 *
 * Example:
 * findLowestValue("physical therapy") ➞ Pair(' ', 2)
 *
 * In this example, the lowest value character is a space (' ') and it appears twice in the string.
 */
fun findLowestValue(input: String): Pair<Char, Int> {
/**
 * This exercise requires you to create a code that finds the lowest value character in a given string and counts how many times it appears.
 *
 * Implement a function called 'findLowestValue" that takes a string as input.
 * The function should iterate over each character in the string and compare it with the other characters.
 * Use nested if-else statements to keep track of the lowest value character.
 * Finally, return the lowest value character and the count of its occurrences as a Pair.
 *
 * Example:
 * findLowestValue("physical therapy") ➞ Pair(' ', 2)
 *
 * In this example, the lowest value character is a space (' ') and it appears twice in the string.
 */
fun findLowestValue(input: String): Pair<Char, Int> {

    var lowestValue: Char? = null
    var lowestCount: Int? = null

    for (char in input) {
        var count = 0
        for (otherChar in input) {
            if (char == otherChar) {
                count++
            }
        }

        if (lowestCount == null || count < lowestCount) {
            lowestValue = char
            lowestCount = count
        }
    }

    return Pair(lowestValue!!, lowestCount!!)
}