/**
 * Given a dictionary of artifacts and their locations, return the location of the artifact of the specified type.
 * The index argument specifies the index of the artifact in case there are multiple artifacts of the same type.
 */
fun findArtifactLocation(artifacts: Map<String, String>, artifactType: String, index: Int): String? {

    // Find the artifacts of the specified type
    val artifactsOfType = mutableListOf<String>()
    for ((artifact, location) in artifacts) {
        if (artifact == artifactType) {
            artifactsOfType.add(location)
        }
    }

    // Check if there are artifacts of the specified type
    if (artifactsOfType.isNotEmpty()) {
        // Check if the index is valid
        if (index >= 0 && index < artifactsOfType.size) {
            // Return the location of the artifact at the specified index
            return artifactsOfType[index]
        }
    }
    // Return null if no valid location is found
    return null
}
/**
 * Given a dictionary of artifacts and their locations, return the location of the artifact of the specified type.
 * The index argument specifies the index of the artifact in case there are multiple artifacts of the same type.
 */
fun findArtifactLocation(artifacts: Map<String, String>, artifactType: String, index: Int): String? {
/**
 * Given a dictionary of artifacts and their locations, return the location of the artifact of the specified type.
 * The index argument specifies the index of the artifact in case there are multiple artifacts of the same type.
 */
fun findArtifactLocation(artifacts: Map<String, String>, artifactType: String, index: Int): String? {

    // Find the artifacts of the specified type
    val artifactsOfType = mutableListOf<String>()
    for ((artifact, location) in artifacts) {
        if (artifact == artifactType) {
            artifactsOfType.add(location)
        }
    }

    // Check if there are artifacts of the specified type
    if (artifactsOfType.isNotEmpty()) {
        // Check if the index is valid
        if (index >= 0 && index < artifactsOfType.size) {
            // Return the location of the artifact at the specified index
            return artifactsOfType[index]
        }
    }
    // Return null if no valid location is found
    return null
}