/**
 * Calculate the sum of squares of all numbers in the given range.
 *
 * @param start The starting number of the range (inclusive).
 * @param stop The ending number of the range (exclusive).
 * @return The sum of squares of all numbers in the range.
 *
 * Example:
 * sumOfSquares(1, 5) returns 30
 * Explanation: The range is [1, 2, 3, 4]. The sum of squares is 1^2 + 2^2 + 3^2 + 4^2 = 30.
 */
fun sumOfSquares(start: Int, stop: Int): Int {

    return (start until stop).sumBy { it * it }
}
/**
 * Calculate the sum of squares of all numbers in the given range.
 *
 * @param start The starting number of the range (inclusive).
 * @param stop The ending number of the range (exclusive).
 * @return The sum of squares of all numbers in the range.
 *
 * Example:
 * sumOfSquares(1, 5) returns 30
 * Explanation: The range is [1, 2, 3, 4]. The sum of squares is 1^2 + 2^2 + 3^2 + 4^2 = 30.
 */
fun sumOfSquares(start: Int, stop: Int): Int {
/**
 * Calculate the sum of squares of all numbers in the given range.
 *
 * @param start The starting number of the range (inclusive).
 * @param stop The ending number of the range (exclusive).
 * @return The sum of squares of all numbers in the range.
 *
 * Example:
 * sumOfSquares(1, 5) returns 30
 * Explanation: The range is [1, 2, 3, 4]. The sum of squares is 1^2 + 2^2 + 3^2 + 4^2 = 30.
 */
fun sumOfSquares(start: Int, stop: Int): Int {

    return (start until stop).sumBy { it * it }
}