/**
 * Given a list of fashion items, return a list of combinations
 * of the items from the start index to the end index (exclusive).
 *
 * @param fashionItems A list of fashion items.
 * @param startIndex The start index to begin slicing.
 * @param endIndex The end index to stop slicing (exclusive).
 * @return A list of combinations of fashion items.
 *
 * Example:
 * fashionItems = listOf("dress", "shirt", "jacket", "pants", "shoes")
 * getCombinations(fashionItems, 1, 4)
 * Output: ['shirt', 'jacket', 'pants']
 */
fun getCombinations(fashionItems: List<String>, startIndex: Int, endIndex: Int): List<List<String>> {

    return (startIndex until endIndex).flatMap { i ->
        (i + 1..endIndex).map { j ->
            fashionItems.subList(i, j)
        }
    }
}

val fashion = listOf("dress", "shirt", "jacket", "pants", "shoes")

// Print all possible combinations of fashion items from the 1st to 4th index (exclusive)
val combinations = getCombinations(fashion, 1, 4)
/**
 * Given a list of fashion items, return a list of combinations
 * of the items from the start index to the end index (exclusive).
 *
 * @param fashionItems A list of fashion items.
 * @param startIndex The start index to begin slicing.
 * @param endIndex The end index to stop slicing (exclusive).
 * @return A list of combinations of fashion items.
 *
 * Example:
 * fashionItems = listOf("dress", "shirt", "jacket", "pants", "shoes")
 * getCombinations(fashionItems, 1, 4)
 * Output: ['shirt', 'jacket', 'pants']
 */
fun getCombinations(fashionItems: List<String>, startIndex: Int, endIndex: Int): List<List<String>> {
/**
 * Given a list of fashion items, return a list of combinations
 * of the items from the start index to the end index (exclusive).
 *
 * @param fashionItems A list of fashion items.
 * @param startIndex The start index to begin slicing.
 * @param endIndex The end index to stop slicing (exclusive).
 * @return A list of combinations of fashion items.
 *
 * Example:
 * fashionItems = listOf("dress", "shirt", "jacket", "pants", "shoes")
 * getCombinations(fashionItems, 1, 4)
 * Output: ['shirt', 'jacket', 'pants']
 */
fun getCombinations(fashionItems: List<String>, startIndex: Int, endIndex: Int): List<List<String>> {

    return (startIndex until endIndex).flatMap { i ->
        (i + 1..endIndex).map { j ->
            fashionItems.subList(i, j)
        }
    }
}

val fashion = listOf("dress", "shirt", "jacket", "pants", "shoes")

// Print all possible combinations of fashion items from the 1st to 4th index (exclusive)
val combinations = getCombinations(fashion, 1, 4)