/**
 * Given a list of tuples containing historical data, the function should return the total number of occurrences
 * where the second element of each tuple is greater than or equal to the first element.
 *
 * @param historyData List of tuples containing historical data.
 * @return Total count of occurrences where the second element is greater than or equal to the first element.
 *
 * Example:
 * accessTupleElements(listOf(1 to 2, 3 to 3, 5 to 4, 2 to 1)) // 3
 * accessTupleElements(listOf(4 to 5, 6 to 3, 2 to 1, 2 to 2)) // 2
 */
fun accessTupleElements(historyData: List<Pair<Int, Int>>): Int {

    var count = 0

    for (data in historyData) {
        if (data.second >= data.first) {
            count++
        }
    }

    return count
}
/**
 * Given a list of tuples containing historical data, the function should return the total number of occurrences
 * where the second element of each tuple is greater than or equal to the first element.
 *
 * @param historyData List of tuples containing historical data.
 * @return Total count of occurrences where the second element is greater than or equal to the first element.
 *
 * Example:
 * accessTupleElements(listOf(1 to 2, 3 to 3, 5 to 4, 2 to 1)) // 3
 * accessTupleElements(listOf(4 to 5, 6 to 3, 2 to 1, 2 to 2)) // 2
 */
fun accessTupleElements(historyData: List<Pair<Int, Int>>): Int {
/**
 * Given a list of tuples containing historical data, the function should return the total number of occurrences
 * where the second element of each tuple is greater than or equal to the first element.
 *
 * @param historyData List of tuples containing historical data.
 * @return Total count of occurrences where the second element is greater than or equal to the first element.
 *
 * Example:
 * accessTupleElements(listOf(1 to 2, 3 to 3, 5 to 4, 2 to 1)) // 3
 * accessTupleElements(listOf(4 to 5, 6 to 3, 2 to 1, 2 to 2)) // 2
 */
fun accessTupleElements(historyData: List<Pair<Int, Int>>): Int {

    var count = 0

    for (data in historyData) {
        if (data.second >= data.first) {
            count++
        }
    }

    return count
}