/**
 * This exercise focuses on working with negative integers within a specific range
 * while utilizing the step parameter to skip certain values.
 *
 * @param start Starting value of the range
 * @param stop Ending value of the range
 * @param step Step value to jump to the next iteration
 * @return List of negative integers within the given range and step value
 */
fun negativeNumbersInRange(start: Int, stop: Int, step: Int): List<Int> {

    // Initialize an empty list to store the negative numbers
    val negativeNums = mutableListOf<Int>()

    // Check if the step value is positive
    var currentStep = step
    if (currentStep > 0) {
        // If the step is positive, change it to negative
        currentStep *= -1
    }

    // Iterate through the range in reverse order with the given step value
    for (num in start downTo stop + 1 step -currentStep) {
        // Check if the current number is negative
        if (num < 0) {
            // Append the negative number to the list
            negativeNums.add(num)
        }
    }

    return negativeNums
}
/**
 * This exercise focuses on working with negative integers within a specific range
 * while utilizing the step parameter to skip certain values.
 *
 * @param start Starting value of the range
 * @param stop Ending value of the range
 * @param step Step value to jump to the next iteration
 * @return List of negative integers within the given range and step value
 */
fun negativeNumbersInRange(start: Int, stop: Int, step: Int): List<Int> {
/**
 * This exercise focuses on working with negative integers within a specific range
 * while utilizing the step parameter to skip certain values.
 *
 * @param start Starting value of the range
 * @param stop Ending value of the range
 * @param step Step value to jump to the next iteration
 * @return List of negative integers within the given range and step value
 */
fun negativeNumbersInRange(start: Int, stop: Int, step: Int): List<Int> {

    // Initialize an empty list to store the negative numbers
    val negativeNums = mutableListOf<Int>()

    // Check if the step value is positive
    var currentStep = step
    if (currentStep > 0) {
        // If the step is positive, change it to negative
        currentStep *= -1
    }

    // Iterate through the range in reverse order with the given step value
    for (num in start downTo stop + 1 step -currentStep) {
        // Check if the current number is negative
        if (num < 0) {
            // Append the negative number to the list
            negativeNums.add(num)
        }
    }

    return negativeNums
}