/**
 * A function that searches for an artifact in a given archeologist map.
 * The function will continue searching until the artifact is found or the entire map has been searched.
 *
 * @param archeologistMap A 2D list representing the archeologist map where 'X' represents the artifact location.
 * @return A tuple containing the coordinates of the artifact or null if not found.
 */
fun searchForArtifact(archeologistMap: List<List<String>>): Pair<Int, Int>? {

    val numRows = archeologistMap.size
    val numCols = archeologistMap[0].size

    for (row in 0 until numRows) {
        for (col in 0 until numCols) {
            if (archeologistMap[row][col] == "X") {
                return Pair(row, col)
            }
        }
    }

    return null
}

// Example usage:

val artifactMap = listOf(
    listOf("o", "o", "o", "o", "o"),
    listOf("o", "o", "o", "o", "o"),
    listOf("o", "o", "o", "X", "o"),
    listOf("o", "o", "o", "o", "o")
)

val artifactLocation = searchForArtifact(artifactMap)
/**
 * A function that searches for an artifact in a given archeologist map.
 * The function will continue searching until the artifact is found or the entire map has been searched.
 *
 * @param archeologistMap A 2D list representing the archeologist map where 'X' represents the artifact location.
 * @return A tuple containing the coordinates of the artifact or null if not found.
 */
fun searchForArtifact(archeologistMap: List<List<String>>): Pair<Int, Int>? {
/**
 * A function that searches for an artifact in a given archeologist map.
 * The function will continue searching until the artifact is found or the entire map has been searched.
 *
 * @param archeologistMap A 2D list representing the archeologist map where 'X' represents the artifact location.
 * @return A tuple containing the coordinates of the artifact or null if not found.
 */
fun searchForArtifact(archeologistMap: List<List<String>>): Pair<Int, Int>? {

    val numRows = archeologistMap.size
    val numCols = archeologistMap[0].size

    for (row in 0 until numRows) {
        for (col in 0 until numCols) {
            if (archeologistMap[row][col] == "X") {
                return Pair(row, col)
            }
        }
    }

    return null
}

// Example usage:

val artifactMap = listOf(
    listOf("o", "o", "o", "o", "o"),
    listOf("o", "o", "o", "o", "o"),
    listOf("o", "o", "o", "X", "o"),
    listOf("o", "o", "o", "o", "o")
)

val artifactLocation = searchForArtifact(artifactMap)