/**
 * Given a list of pipelines, each represented as a triple with 3 elements: (pipelineName, length, isActive),
 * the function findMaxPipeline should find the maximum length of active pipelines.
 *
 * @param pipelines a list of triples representing pipelines, where each triple contains the pipeline name (a string),
 * the length of the pipeline (an integer), and whether the pipeline is active or not (a boolean).
 * @return max length an integer representing the maximum length among all active pipelines.
 *
 * Note:
 * Only active pipelines should be considered for finding the maximum length.
 *
 * Example:
 * findMaxPipeline(listOf("Pipeline A" to 10 to false, "Pipeline B" to 15 to true, "Pipeline C" to 5 to true))
 * Output: 15
 */
fun findMaxPipeline(pipelines: List<Triple<String, Int, Boolean>>): Int {

    val activePipelines = pipelines.filter { it.third }
    val pipelineLengths = activePipelines.map { it.second }
    val maxLength = pipelineLengths.maxOrNull() ?: 0

    return maxLength
}
/**
 * Given a list of pipelines, each represented as a triple with 3 elements: (pipelineName, length, isActive),
 * the function findMaxPipeline should find the maximum length of active pipelines.
 *
 * @param pipelines a list of triples representing pipelines, where each triple contains the pipeline name (a string),
 * the length of the pipeline (an integer), and whether the pipeline is active or not (a boolean).
 * @return max length an integer representing the maximum length among all active pipelines.
 *
 * Note:
 * Only active pipelines should be considered for finding the maximum length.
 *
 * Example:
 * findMaxPipeline(listOf("Pipeline A" to 10 to false, "Pipeline B" to 15 to true, "Pipeline C" to 5 to true))
 * Output: 15
 */
fun findMaxPipeline(pipelines: List<Triple<String, Int, Boolean>>): Int {
/**
 * Given a list of pipelines, each represented as a triple with 3 elements: (pipelineName, length, isActive),
 * the function findMaxPipeline should find the maximum length of active pipelines.
 *
 * @param pipelines a list of triples representing pipelines, where each triple contains the pipeline name (a string),
 * the length of the pipeline (an integer), and whether the pipeline is active or not (a boolean).
 * @return max length an integer representing the maximum length among all active pipelines.
 *
 * Note:
 * Only active pipelines should be considered for finding the maximum length.
 *
 * Example:
 * findMaxPipeline(listOf("Pipeline A" to 10 to false, "Pipeline B" to 15 to true, "Pipeline C" to 5 to true))
 * Output: 15
 */
fun findMaxPipeline(pipelines: List<Triple<String, Int, Boolean>>): Int {

    val activePipelines = pipelines.filter { it.third }
    val pipelineLengths = activePipelines.map { it.second }
    val maxLength = pipelineLengths.maxOrNull() ?: 0

    return maxLength
}