/**
 * Given a list of numbers representing the positions of objects on a number line and a point,
 * this function returns true if the point lies on or between any two numbers in the list, and false otherwise.
 *
 * @param numbers A list of floating-point numbers representing the positions of objects.
 * @param point A floating-point number representing the point to be checked.
 * @return true if the point lies on or between any two numbers in the list, false otherwise.
 */
fun photographerNumberLine(numbers: List<Double>, point: Double): Boolean {

    // Sort the list in ascending order
    val sortedNumbers = numbers.sorted()

    // Iterate through the numbers list
    for (i in 0 until sortedNumbers.size - 1) {
        // Check if the point is between two consecutive numbers
        if (sortedNumbers[i] <= point && point <= sortedNumbers[i + 1]) {
            return true
        }
    }
    
    return false
}
/**
 * Given a list of numbers representing the positions of objects on a number line and a point,
 * this function returns true if the point lies on or between any two numbers in the list, and false otherwise.
 *
 * @param numbers A list of floating-point numbers representing the positions of objects.
 * @param point A floating-point number representing the point to be checked.
 * @return true if the point lies on or between any two numbers in the list, false otherwise.
 */
fun photographerNumberLine(numbers: List<Double>, point: Double): Boolean {
/**
 * Given a list of numbers representing the positions of objects on a number line and a point,
 * this function returns true if the point lies on or between any two numbers in the list, and false otherwise.
 *
 * @param numbers A list of floating-point numbers representing the positions of objects.
 * @param point A floating-point number representing the point to be checked.
 * @return true if the point lies on or between any two numbers in the list, false otherwise.
 */
fun photographerNumberLine(numbers: List<Double>, point: Double): Boolean {

    // Sort the list in ascending order
    val sortedNumbers = numbers.sorted()

    // Iterate through the numbers list
    for (i in 0 until sortedNumbers.size - 1) {
        // Check if the point is between two consecutive numbers
        if (sortedNumbers[i] <= point && point <= sortedNumbers[i + 1]) {
            return true
        }
    }
    
    return false
}