/**
 * Given two numbers a and b, find their common multiples and return them as a list.
 */
fun commonMultiples(a: Int, b: Int): List<Int> {

    val multiples = mutableListOf<Int>()
    var i = maxOf(a, b)

    while (true) {
        if (i % a == 0 && i % b == 0) {
            multiples.add(i)
        }
        // Increase i by max(a, b) to ensure i is always a multiple of both a and b
        i += maxOf(a, b)

        if (multiples.size >= 10) {
            break
        }
    }

    return multiples
}
/**
 * Given two numbers a and b, find their common multiples and return them as a list.
 */
fun commonMultiples(a: Int, b: Int): List<Int> {
/**
 * Given two numbers a and b, find their common multiples and return them as a list.
 */
fun commonMultiples(a: Int, b: Int): List<Int> {

    val multiples = mutableListOf<Int>()
    var i = maxOf(a, b)

    while (true) {
        if (i % a == 0 && i % b == 0) {
            multiples.add(i)
        }
        // Increase i by max(a, b) to ensure i is always a multiple of both a and b
        i += maxOf(a, b)

        if (multiples.size >= 10) {
            break
        }
    }

    return multiples
}