/**
 * Given a message, break it into two parts and return them separately.
 * If the message contains the word 'police', break the message right before it.
 * If the word doesn't exist, return the entire message.
 *
 * Example:
 * breakStringSlice("Hello, this is the police. Please stay calm.") ➞ ["Hello, this is the ", "police. Please stay calm."]
 * breakStringSlice("There is no police presence here.") ➞ "There is no police presence here."
 * breakStringSlice("Police officers enforce the law.") ➞ ["", "Police officers enforce the law."]
 *
 * @param message A string representing the given message.
 * @return A list with two items, the first part of the message before 'police' (if present) and the second part of the message after 'police'.
 * If 'police' doesn't exist, returns the entire message as a string.
 * Break the message into two parts using string slicing and the break statement to solve this exercise.
 */
fun breakStringSlice(message: String): Any {

    if (!message.contains("police")) {
        return message
    }

    val index = message.indexOf("police")
    return listOf(message.substring(0, index), message.substring(index))
}
/**
 * Given a message, break it into two parts and return them separately.
 * If the message contains the word 'police', break the message right before it.
 * If the word doesn't exist, return the entire message.
 *
 * Example:
 * breakStringSlice("Hello, this is the police. Please stay calm.") ➞ ["Hello, this is the ", "police. Please stay calm."]
 * breakStringSlice("There is no police presence here.") ➞ "There is no police presence here."
 * breakStringSlice("Police officers enforce the law.") ➞ ["", "Police officers enforce the law."]
 *
 * @param message A string representing the given message.
 * @return A list with two items, the first part of the message before 'police' (if present) and the second part of the message after 'police'.
 * If 'police' doesn't exist, returns the entire message as a string.
 * Break the message into two parts using string slicing and the break statement to solve this exercise.
 */
fun breakStringSlice(message: String): Any {
/**
 * Given a message, break it into two parts and return them separately.
 * If the message contains the word 'police', break the message right before it.
 * If the word doesn't exist, return the entire message.
 *
 * Example:
 * breakStringSlice("Hello, this is the police. Please stay calm.") ➞ ["Hello, this is the ", "police. Please stay calm."]
 * breakStringSlice("There is no police presence here.") ➞ "There is no police presence here."
 * breakStringSlice("Police officers enforce the law.") ➞ ["", "Police officers enforce the law."]
 *
 * @param message A string representing the given message.
 * @return A list with two items, the first part of the message before 'police' (if present) and the second part of the message after 'police'.
 * If 'police' doesn't exist, returns the entire message as a string.
 * Break the message into two parts using string slicing and the break statement to solve this exercise.
 */
fun breakStringSlice(message: String): Any {

    if (!message.contains("police")) {
        return message
    }

    val index = message.indexOf("police")
    return listOf(message.substring(0, index), message.substring(index))
}