/**
 * This exercise requires the astronomer to iterate through a given string and create a number line representation
 * based on the number of occurrences of each character in the string. The astronomer can only use while loop to accomplish this task.
 *
 * @param string The input string.
 * @param number The number to represent the string.
 * @return A string representing the number line representation of the given string.
 */
fun stringNumberIntersection(string: String, number: Int): String {

    var count = 0
    var index = 0
    var numberLine = ""

    while (count < number) {
        if (index >= string.length) {
            index = 0
        }

        val character = string[index]

        if (character !in numberLine) {
            numberLine += character
            count++
        }

        index++
    }

    return numberLine
}

// Example usage
/**
 * This exercise requires the astronomer to iterate through a given string and create a number line representation
 * based on the number of occurrences of each character in the string. The astronomer can only use while loop to accomplish this task.
 *
 * @param string The input string.
 * @param number The number to represent the string.
 * @return A string representing the number line representation of the given string.
 */
fun stringNumberIntersection(string: String, number: Int): String {
/**
 * This exercise requires the astronomer to iterate through a given string and create a number line representation
 * based on the number of occurrences of each character in the string. The astronomer can only use while loop to accomplish this task.
 *
 * @param string The input string.
 * @param number The number to represent the string.
 * @return A string representing the number line representation of the given string.
 */
fun stringNumberIntersection(string: String, number: Int): String {

    var count = 0
    var index = 0
    var numberLine = ""

    while (count < number) {
        if (index >= string.length) {
            index = 0
        }

        val character = string[index]

        if (character !in numberLine) {
            numberLine += character
            count++
        }

        index++
    }

    return numberLine
}

// Example usage