/**
 * Given a range from 'start' to 'end', find the sum of all odd numbers in the range.
 *
 * @param start The start of the range (inclusive).
 * @param end The end of the range (exclusive).
 * @return The sum of all odd numbers in the range.
 * @throws IllegalArgumentException If 'start' is greater than 'end'.
 *
 * Example:
 * sumOfOddNumbers(5, 15) => 69
 * sumOfOddNumbers(10, 20) => 75
 */
fun sumOfOddNumbers(start: Int, end: Int): Int {

    if (start > end) {
        throw IllegalArgumentException("'start' cannot be greater than 'end'.")
    }
    
    return (start until end).filter { it % 2 != 0 }.sum()
}
/**
 * Given a range from 'start' to 'end', find the sum of all odd numbers in the range.
 *
 * @param start The start of the range (inclusive).
 * @param end The end of the range (exclusive).
 * @return The sum of all odd numbers in the range.
 * @throws IllegalArgumentException If 'start' is greater than 'end'.
 *
 * Example:
 * sumOfOddNumbers(5, 15) => 69
 * sumOfOddNumbers(10, 20) => 75
 */
fun sumOfOddNumbers(start: Int, end: Int): Int {
/**
 * Given a range from 'start' to 'end', find the sum of all odd numbers in the range.
 *
 * @param start The start of the range (inclusive).
 * @param end The end of the range (exclusive).
 * @return The sum of all odd numbers in the range.
 * @throws IllegalArgumentException If 'start' is greater than 'end'.
 *
 * Example:
 * sumOfOddNumbers(5, 15) => 69
 * sumOfOddNumbers(10, 20) => 75
 */
fun sumOfOddNumbers(start: Int, end: Int): Int {

    if (start > end) {
        throw IllegalArgumentException("'start' cannot be greater than 'end'.")
    }
    
    return (start until end).filter { it % 2 != 0 }.sum()
}