/**
 * **Physical Therapist Exercise**
 * This exercise requires you to find the index positions of a given character in a string using a loop.
 *
 * @param string A string of characters.
 * @param character The character to find in the string.
 * @return A list consisting of the index positions of the character in the string.
 *
 * Example:
 * characterIndex("Hello World", 'o')
 * Output: [4, 7]
 */
fun characterIndex(string: String, character: Char): List<Int> {

    val indices = mutableListOf<Int>()
    
    for (i in string.indices) {
        if (string[i] == character) {
            indices.add(i)
        }
    }
    
    return indices
}
/**
 * **Physical Therapist Exercise**
 * This exercise requires you to find the index positions of a given character in a string using a loop.
 *
 * @param string A string of characters.
 * @param character The character to find in the string.
 * @return A list consisting of the index positions of the character in the string.
 *
 * Example:
 * characterIndex("Hello World", 'o')
 * Output: [4, 7]
 */
fun characterIndex(string: String, character: Char): List<Int> {
/**
 * **Physical Therapist Exercise**
 * This exercise requires you to find the index positions of a given character in a string using a loop.
 *
 * @param string A string of characters.
 * @param character The character to find in the string.
 * @return A list consisting of the index positions of the character in the string.
 *
 * Example:
 * characterIndex("Hello World", 'o')
 * Output: [4, 7]
 */
fun characterIndex(string: String, character: Char): List<Int> {

    val indices = mutableListOf<Int>()
    
    for (i in string.indices) {
        if (string[i] == character) {
            indices.add(i)
        }
    }
    
    return indices
}