/**
 * Firefighter exercise:
 * Given two strings, fireTruck and hydrant, write a code to slice both strings and find the index
 * at which the first different character occurs. Return the index.
 *
 * Example:
 * ---------
 * fireTruck = "FIREFIGHTER"
 * hydrant = "FIERYPANTS"
 *
 * Slicing fireTruck from index 0 to 5 gives 'FIREF'. Slicing hydrant from index 0 to 5 gives 'FIERP'.
 * The first different character occurs at index 5. Therefore, the expected output is 5.
 */
fun stringSlicingNotEqual(fireTruck: String, hydrant: String): Int {

    for (i in 0 until minOf(fireTruck.length, hydrant.length)) {
        if (fireTruck[i] != hydrant[i]) {
            return i
        }
    }
    return minOf(fireTruck.length, hydrant.length)
}
/**
 * Firefighter exercise:
 * Given two strings, fireTruck and hydrant, write a code to slice both strings and find the index
 * at which the first different character occurs. Return the index.
 *
 * Example:
 * ---------
 * fireTruck = "FIREFIGHTER"
 * hydrant = "FIERYPANTS"
 *
 * Slicing fireTruck from index 0 to 5 gives 'FIREF'. Slicing hydrant from index 0 to 5 gives 'FIERP'.
 * The first different character occurs at index 5. Therefore, the expected output is 5.
 */
fun stringSlicingNotEqual(fireTruck: String, hydrant: String): Int {
/**
 * Firefighter exercise:
 * Given two strings, fireTruck and hydrant, write a code to slice both strings and find the index
 * at which the first different character occurs. Return the index.
 *
 * Example:
 * ---------
 * fireTruck = "FIREFIGHTER"
 * hydrant = "FIERYPANTS"
 *
 * Slicing fireTruck from index 0 to 5 gives 'FIREF'. Slicing hydrant from index 0 to 5 gives 'FIERP'.
 * The first different character occurs at index 5. Therefore, the expected output is 5.
 */
fun stringSlicingNotEqual(fireTruck: String, hydrant: String): Int {

    for (i in 0 until minOf(fireTruck.length, hydrant.length)) {
        if (fireTruck[i] != hydrant[i]) {
            return i
        }
    }
    return minOf(fireTruck.length, hydrant.length)
}