/**
 * Given two positive integers n and m, count the number of combinations of two tuples
 * (a, b) such that 0 <= a < n and 0 <= b < m.
 *
 * @param n an integer representing the upper bound (exclusive) for the first element of the tuple
 * @param m an integer representing the upper bound (exclusive) for the second element of the tuple
 * @return an integer representing the total number of combinations
 *
 * Example:
 * countCombinations(3, 4) -> 12
 * countCombinations(2, 2) -> 4
 */
fun countCombinations(n: Int, m: Int): Int {

    var count = 0
    for (a in 0 until n) {
        for (b in 0 until m) {
            if (a != b) {
                count++
            }
        }
    }
    return count
}
/**
 * Given two positive integers n and m, count the number of combinations of two tuples
 * (a, b) such that 0 <= a < n and 0 <= b < m.
 *
 * @param n an integer representing the upper bound (exclusive) for the first element of the tuple
 * @param m an integer representing the upper bound (exclusive) for the second element of the tuple
 * @return an integer representing the total number of combinations
 *
 * Example:
 * countCombinations(3, 4) -> 12
 * countCombinations(2, 2) -> 4
 */
fun countCombinations(n: Int, m: Int): Int {
/**
 * Given two positive integers n and m, count the number of combinations of two tuples
 * (a, b) such that 0 <= a < n and 0 <= b < m.
 *
 * @param n an integer representing the upper bound (exclusive) for the first element of the tuple
 * @param m an integer representing the upper bound (exclusive) for the second element of the tuple
 * @return an integer representing the total number of combinations
 *
 * Example:
 * countCombinations(3, 4) -> 12
 * countCombinations(2, 2) -> 4
 */
fun countCombinations(n: Int, m: Int): Int {

    var count = 0
    for (a in 0 until n) {
        for (b in 0 until m) {
            if (a != b) {
                count++
            }
        }
    }
    return count
}