/**
 * The purpose of this exercise is to implement error handling while using the indexOf() method to search for a document in a lawyer's collection of papers.
 *
 * @param papers A list of documents in the collection.
 * @param document The document to search for.
 * @return The index of the document if found, otherwise -1.
 */
fun index(papers: List<String>, document: String): Int {

    return try {
        papers.indexOf(document)
    } catch (e: NoSuchElementException) {
        -1
    }
}
/**
 * The purpose of this exercise is to implement error handling while using the indexOf() method to search for a document in a lawyer's collection of papers.
 *
 * @param papers A list of documents in the collection.
 * @param document The document to search for.
 * @return The index of the document if found, otherwise -1.
 */
fun index(papers: List<String>, document: String): Int {
/**
 * The purpose of this exercise is to implement error handling while using the indexOf() method to search for a document in a lawyer's collection of papers.
 *
 * @param papers A list of documents in the collection.
 * @param document The document to search for.
 * @return The index of the document if found, otherwise -1.
 */
fun index(papers: List<String>, document: String): Int {

    return try {
        papers.indexOf(document)
    } catch (e: NoSuchElementException) {
        -1
    }
}