/**
 * Given a tuple 'data' containing sequence data, return the subsequence string
 * between the two given indices (inclusive).
 *
 * @param data A tuple containing sequence data.
 * @param index1 The starting index of the subsequence.
 * @param index2 The ending index of the subsequence.
 * @return The subsequence string between index1 and index2.
 */
fun getSequenceData(data: List<Char>, index1: Int, index2: Int): String {

    // Check if the provided indices are within the tuple
    if (index1 >= 0 && index2 < data.size && index1 <= index2) {
        val subsequence = data.subList(index1, index2 + 1).joinToString("")
        return subsequence
    }

    // Check if index1 is negative
    else if (index1 < 0 && index2 < data.size) {
        val subsequence = data.subList(index1, data.size).joinToString("")
        return subsequence
    }

    // Check if index2 is greater than or equal to the tuple length
    else if (index2 >= data.size && index1 >= 0) {
        val subsequence = data.subList(0, index2).joinToString("")
        return subsequence
    }

    return ""
}
/**
 * Given a tuple 'data' containing sequence data, return the subsequence string
 * between the two given indices (inclusive).
 *
 * @param data A tuple containing sequence data.
 * @param index1 The starting index of the subsequence.
 * @param index2 The ending index of the subsequence.
 * @return The subsequence string between index1 and index2.
 */
fun getSequenceData(data: List<Char>, index1: Int, index2: Int): String {
/**
 * Given a tuple 'data' containing sequence data, return the subsequence string
 * between the two given indices (inclusive).
 *
 * @param data A tuple containing sequence data.
 * @param index1 The starting index of the subsequence.
 * @param index2 The ending index of the subsequence.
 * @return The subsequence string between index1 and index2.
 */
fun getSequenceData(data: List<Char>, index1: Int, index2: Int): String {

    // Check if the provided indices are within the tuple
    if (index1 >= 0 && index2 < data.size && index1 <= index2) {
        val subsequence = data.subList(index1, index2 + 1).joinToString("")
        return subsequence
    }

    // Check if index1 is negative
    else if (index1 < 0 && index2 < data.size) {
        val subsequence = data.subList(index1, data.size).joinToString("")
        return subsequence
    }

    // Check if index2 is greater than or equal to the tuple length
    else if (index2 >= data.size && index1 >= 0) {
        val subsequence = data.subList(0, index2).joinToString("")
        return subsequence
    }

    return ""
}