/**
 * Given a wardrobe map and a list of colors, return the index of the first appearance
 * for each color in the wardrobe. If a color is not found, return -1 for that color.
 *
 * @param wardrobe A map representing the wardrobe containing clothes.
 * @param colors A list of colors for which to find their respective indices in the wardrobe.
 * @return A map mapping each color to its index in the wardrobe, or -1 if the color is not found.
 */
fun findColorIndices(wardrobe: Map<String, List<Int>>, colors: List<String>): Map<String, Int> {

    val colorIndices = mutableMapOf<String, Int>()
    for (color in colors) {
        if (wardrobe.containsKey(color)) {
            colorIndices[color] = wardrobe[color]?.indexOf(0) ?: -1
            if (colorIndices[color] == -1) {
                colorIndices[color] = wardrobe[color]?.indexOf(1) ?: -1
            }
        } else {
            colorIndices[color] = -1
        }
    }
    return colorIndices
}
/**
 * Given a wardrobe map and a list of colors, return the index of the first appearance
 * for each color in the wardrobe. If a color is not found, return -1 for that color.
 *
 * @param wardrobe A map representing the wardrobe containing clothes.
 * @param colors A list of colors for which to find their respective indices in the wardrobe.
 * @return A map mapping each color to its index in the wardrobe, or -1 if the color is not found.
 */
fun findColorIndices(wardrobe: Map<String, List<Int>>, colors: List<String>): Map<String, Int> {
/**
 * Given a wardrobe map and a list of colors, return the index of the first appearance
 * for each color in the wardrobe. If a color is not found, return -1 for that color.
 *
 * @param wardrobe A map representing the wardrobe containing clothes.
 * @param colors A list of colors for which to find their respective indices in the wardrobe.
 * @return A map mapping each color to its index in the wardrobe, or -1 if the color is not found.
 */
fun findColorIndices(wardrobe: Map<String, List<Int>>, colors: List<String>): Map<String, Int> {

    val colorIndices = mutableMapOf<String, Int>()
    for (color in colors) {
        if (wardrobe.containsKey(color)) {
            colorIndices[color] = wardrobe[color]?.indexOf(0) ?: -1
            if (colorIndices[color] == -1) {
                colorIndices[color] = wardrobe[color]?.indexOf(1) ?: -1
            }
        } else {
            colorIndices[color] = -1
        }
    }
    return colorIndices
}