/**
 * Given two lists of floating-point numbers, find the common values between them
 * by using indexing and floating-point arithmetic operations.
 *
 * @param arr1 The first list of floating-point numbers.
 * @param arr2 The second list of floating-point numbers.
 * @return A list containing the common values between arr1 and arr2.
 *
 * Note:
 * - The solution should not use any classes.
 * - The solution should be implemented using indexing and floating-point arithmetic operations.
 * - The code should handle floating-point precision errors.
 */
fun findCommonValues(arr1: List<Double>, arr2: List<Double>): List<Double> {

    val commonValues = mutableListOf<Double>()

    // Iterate over the first list of numbers
    for (num1 in arr1) {
        // Iterate over the second list of numbers
        for (num2 in arr2) {
            // Check if the two numbers are approximately equal
            if (Math.abs(num1 - num2) < 0.000001) {
                commonValues.add(num1)
                break
            }
        }
    }

    return commonValues
}
/**
 * Given two lists of floating-point numbers, find the common values between them
 * by using indexing and floating-point arithmetic operations.
 *
 * @param arr1 The first list of floating-point numbers.
 * @param arr2 The second list of floating-point numbers.
 * @return A list containing the common values between arr1 and arr2.
 *
 * Note:
 * - The solution should not use any classes.
 * - The solution should be implemented using indexing and floating-point arithmetic operations.
 * - The code should handle floating-point precision errors.
 */
fun findCommonValues(arr1: List<Double>, arr2: List<Double>): List<Double> {
/**
 * Given two lists of floating-point numbers, find the common values between them
 * by using indexing and floating-point arithmetic operations.
 *
 * @param arr1 The first list of floating-point numbers.
 * @param arr2 The second list of floating-point numbers.
 * @return A list containing the common values between arr1 and arr2.
 *
 * Note:
 * - The solution should not use any classes.
 * - The solution should be implemented using indexing and floating-point arithmetic operations.
 * - The code should handle floating-point precision errors.
 */
fun findCommonValues(arr1: List<Double>, arr2: List<Double>): List<Double> {

    val commonValues = mutableListOf<Double>()

    // Iterate over the first list of numbers
    for (num1 in arr1) {
        // Iterate over the second list of numbers
        for (num2 in arr2) {
            // Check if the two numbers are approximately equal
            if (Math.abs(num1 - num2) < 0.000001) {
                commonValues.add(num1)
                break
            }
        }
    }

    return commonValues
}