/**
 * This function takes a list of crops harvested by a farmer and returns another list of crops
 * that fall within the given range of negative values.
 *
 * @param farmerCrops A list of crops (negative and positive values)
 * @param minRange The minimum range value (inclusive)
 * @param maxRange The maximum range value (inclusive)
 * @return A list of crops that fall within the given range of negative values
 *
 * Example:
 * getNegativeCrops(listOf(-5, -10, 3, -12, 8), -15, -5) -> [-10, -12]
 * getNegativeCrops(listOf(1, 10, -4, -7, 5), -10, -1) -> [-4, -7]
 */
fun getNegativeCrops(farmerCrops: List<Int>, minRange: Int, maxRange: Int): List<Int> {

    val negativeCrops = mutableListOf<Int>()
    for (crop in farmerCrops) {
        if (crop < 0 && minRange <= crop && crop <= maxRange) {
            negativeCrops.add(crop)
        }
    }
    return negativeCrops
}
/**
 * This function takes a list of crops harvested by a farmer and returns another list of crops
 * that fall within the given range of negative values.
 *
 * @param farmerCrops A list of crops (negative and positive values)
 * @param minRange The minimum range value (inclusive)
 * @param maxRange The maximum range value (inclusive)
 * @return A list of crops that fall within the given range of negative values
 *
 * Example:
 * getNegativeCrops(listOf(-5, -10, 3, -12, 8), -15, -5) -> [-10, -12]
 * getNegativeCrops(listOf(1, 10, -4, -7, 5), -10, -1) -> [-4, -7]
 */
fun getNegativeCrops(farmerCrops: List<Int>, minRange: Int, maxRange: Int): List<Int> {
/**
 * This function takes a list of crops harvested by a farmer and returns another list of crops
 * that fall within the given range of negative values.
 *
 * @param farmerCrops A list of crops (negative and positive values)
 * @param minRange The minimum range value (inclusive)
 * @param maxRange The maximum range value (inclusive)
 * @return A list of crops that fall within the given range of negative values
 *
 * Example:
 * getNegativeCrops(listOf(-5, -10, 3, -12, 8), -15, -5) -> [-10, -12]
 * getNegativeCrops(listOf(1, 10, -4, -7, 5), -10, -1) -> [-4, -7]
 */
fun getNegativeCrops(farmerCrops: List<Int>, minRange: Int, maxRange: Int): List<Int> {

    val negativeCrops = mutableListOf<Int>()
    for (crop in farmerCrops) {
        if (crop < 0 && minRange <= crop && crop <= maxRange) {
            negativeCrops.add(crop)
        }
    }
    return negativeCrops
}